Php jQuery验证在无效后未验证
输入: 验证工作正常,直到我没有插入现有电子邮件,在我将此电子邮件更改为不存在后,但验证显示此电子邮件存在,但php函数返回truePhp jQuery验证在无效后未验证,php,jquery,ajax,jquery-validate,Php,Jquery,Ajax,Jquery Validate,输入: 验证工作正常,直到我没有插入现有电子邮件,在我将此电子邮件更改为不存在后,但验证显示此电子邮件存在,但php函数返回true cmp_email: { minlength: 5, required: true, email: true, remote: { url: "\/client\/check-email", type: "post" }, }, 我收到了一封主题为“after true”的电子邮件,但验证表明此电子邮件存在。PHP函数工作正
cmp_email: {
minlength: 5,
required: true,
email: true,
remote: {
url: "\/client\/check-email",
type: "post"
},
},
我收到了一封主题为“after true”的电子邮件,但验证表明此电子邮件存在。PHP函数工作正常,当jQuery将现有电子邮件更改为不存在,但jQuery表示电子邮件存在时,jQuery出现问题。尝试将电子邮件缓存设置为false
public function checkEmailAction(){
$email = $_POST;
//echo 'true';
try{
foreach($email as $m){
if($this->client_emails->emailCount($m)){
echo 'false';
die();
}
}
foreach($email['cl_email'] as $m){
if($this->client_emails->emailCount($m)){
echo 'false';
die();
}
}
}
catch(Exception $e){
}
echo 'true';
mail('tomas@example.lt','after true',print_r($_POST,true));
die();
}
这对我也没有帮助。尝试更改输入的类型(type='email')您将现有电子邮件存储在哪里,mysql数据库?是的,在mysql数据库中,但使用函数可以,函数返回corect ansver。我真的不理解您的检查电子邮件操作方法,但我可以向您提供一个我已经使用过的示例。检查我的答案。你所展示的没有任何东西能给你一个答案。”example@gmail.com“存在”消息。换句话说,你给我们展示的例子是不完整的。
public function checkEmailAction(){
$email = $_POST;
//echo 'true';
try{
foreach($email as $m){
if($this->client_emails->emailCount($m)){
echo 'false';
die();
}
}
foreach($email['cl_email'] as $m){
if($this->client_emails->emailCount($m)){
echo 'false';
die();
}
}
}
catch(Exception $e){
}
echo 'true';
mail('tomas@example.lt','after true',print_r($_POST,true));
die();
}
email: {
required: true,
email: true,
remote: {
url: "\/client\/check-email",
type: "post",
cache: false
}
},