从PHP版本5.3.2-1ubuntu4.18升级到5.3.2-1ubuntu4.20停止了我的表单工作?

时间:2013-08-05 14:44:10

标签: php forms validation email preg-match

我在我的vps上有plesk并在标题中升级了php,现在我的php表单脚本已经停止工作了。它进入电子邮件验证并返回电子邮件无效。它看起来好了 - 尝试了多个不同的preg_match字符串 - 任何想法。

 if (!preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i", $email)) {
  echo "<p>It appears you entered an invalid email address</p><p><a href='javascript: history.go(-1)'><font color=\"orange\">Click here to go back</font></a></p>"; 
} 

 elseif (!trim($name)) { 
  echo "<p>Please go back and enter a Name</p><p><a href='javascript: history.go(-1)'><font color=\"orange\">Click here to go back</font></a></p>"; 
}  

 elseif (!trim($email)) { 
  echo "<p>Please go back and enter an Email</p><p><a href='javascript: history.go(-1)'><font color=\"orange\">Click here to go back</font></a></p>"; 
} 

 elseif (!trim($telephone)) { 
  echo "<p>Please go back and enter a Telephone number</p><p><a href='javascript: history.go(-1)'><font color=\"orange\">Click here to go back</font></a></p>"; 
}

 elseif (!trim($eventaddress)) { 
  echo "<p>Please go back and enter the Event address number</p><p><a href='javascript: history.go(-1)'><font color=\"orange\">Click here to go back</font></a></p>"; 
}

0 个答案:

没有答案