我在第4行遇到问题。每个人提交的时间和电子邮件都是虚假条目,我收到此错误
致命错误:未捕获错误:在/homepages/29/d409157025/htdocs/contacts.php:31中调用未定义函数eregi()堆栈跟踪:#home {29} / dp9157025 / htdocs /#0 {main}第4行的contacts.php
自上传以来,该表格完美无缺,已经过了一年多。
//Check to make sure sure that a valid email address is submitted
if(trim($_POST['email']) == '') {
$hasError = true;
} else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", trim($_POST['email']))) {
$hasError = true;
} else {
$email = trim($_POST['email']);
}
//Check to make sure comments were entered
if(trim($_POST['message']) == '') {
$hasError = true;
} else {
if(function_exists('stripslashes')) {
$comments = stripslashes(trim($_POST['message']));
} else {
$comments = trim($_POST['message']);
}
}
//If there is no error, send the email
if(!isset($hasError)) {
$emailTo = 'info@roswellhistoriccottage.com, artem.alek@icloud.com'; //Put your own email address here
$body = "Name: $name \n\nEmail: $email \n\nComments:\n $comments";
$headers = 'From: RHC Website Information Request <'.$emailTo.'>' . "\r\n" . 'Reply-To: ' . $email;
mail($emailTo, $subject, $body, $headers);
$emailSent = true;
}