1
我無法從php函數調用返回值。無法從類函數調用返回布爾值
...
$dey=$validate->yoxla($this->ad,$this->soyad,$this->istadi,$this->sifre,$this->email);
if($dey){ // i cant get returned value from here. even it is true.
echo 'asd';
if(!$checkuser->checkusername($this->istadi)){
$err=array();
$err['code']='code14';
$err['aciglama']=$code14;
print json_encode($err);
die();
}elseif(!$checkuser->checkemail($this->email)){
$err=array();
$err['code']='code15';
$err['aciglama']=$code15;
print json_encode($err);
die();
}else{
$err=array();
$err['code']='acig';
print json_encode($err);
die();
}
}
yoxla()函數:
...
elseif (!preg_match("/^.*(?=.{8,})(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z]).*$/", $sifre)){
$err=array();
$err['code']='code11';
$err['aciglama']=$code11;
print json_encode($err);
die();
}elseif($email==""){
$err=array();
$err['code']='code12';
$err['aciglama']=$code12;
print json_encode($err);
die();
}elseif (!$this->validEmail($email)) {
$err=array();
$err['code']='code13';
$err['aciglama']=$code13;
print json_encode($err);
die();
}else{
return true;
}
我調用由AJAX請求第一個。並沒有什麼返回ajax或我不能從getresult()函數返回值。
問題更新。 –
你應該第一次發佈正確的代碼,現在答案與問題不符。 – julekgwa
Sory它是我的錯( –