当我尝试测试“联系我们”表单时,我收到此错误。填写表格并点击发送后我收到此错误
http://i62.tinypic.com/axz3ir.png
然而,这是我的代码:HTML
<!------contact------------->
<div class="contact" id="contact">
<h3 class="heading">Contact</h3>
<p class="desc">we would really love to hear from you</p>
<h6> </h6>
<div class="contact-bg">
<div class="tool_tip">
<a href="#"><img src="web/images/logo1.png"/></a>
</div>
<div class="wrap">
<div class="form">
<div class="contact-form">
<form method="post" action="contact-post.html">
<div>
<span><label>Name</label></span>
<span><input name="userName" type="text" class="textbox"></span>
</div>
<div>
<span><label>E-Mail</label></span>
<span><input name="userEmail" type="text" class="textbox"></span>
</div>
<div>
<span><label>Subject</label></span>
<span><input name="userPhone" type="text" class="textbox"></span>
</div>
<div>
<span><label>Message</label></span>
<span><textarea name="userMsg"> </textarea></span>
</div>
<div>
<span><input type="submit" value="Send"></span>
</div>
</form>
</div>
<div class="address">
<h3 class="heading">Contactinfo</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt.</p>
<p>quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<div class="c_grids">
<a class=" icon pointor" href="#"> </a>
<p>Lorem ipsum dolor 123</p>
<p>1000 Lorem ipsum</p>
<div class="clear"> </div>
</div>
<div class="c_grids">
<a class=" icon contact-img" href="#"> </a>
<p>Lorem ipsum dolor 123</p>
<p>1000 Lorem ipsum</p>
<div class="clear"> </div>
</div>
<div class="c_grids">
<a class=" icon website" href="#"> </a>
<p>Lorem ipsum dolor 123</p>
<p>1000 Lorem ipsum</p>
<div class="clear"> </div>
</div>
</div>
<div class="clear"> </div>
</div>
</div>
</div>
</div>
<!------end-contact--------->
这是我的PHP代码:
<?php
include "app/config.php";
include "app/detect.php";
if ($page_name=='') {
include $browser_t.'/index.html';
}
elseif ($page_name=='index.html') {
include $browser_t.'/index.html';
}
elseif ($page_name=='contact-post.html') {
include 'app/contact.php';
}
else
{
include $browser_t.'/404.html';
}
?>
并将其指向此代码:
<?php
$userName=$_REQUEST['userName'];
$userEmail=$_REQUEST['userEmail'];
//$userPhone=$_REQUEST['userPhone'];
$userMsg=$_REQUEST['userMsg'];
$subject = "Message from ".$userName;
$message = '<html><head><title>'.$subject.'</title></head><body><table><tr><td>Email id : </td><td> '.$userEmail.'</td></tr>
<tr><td>Phone No : </td><td> '.$userName.'</td></tr><tr><td>Says : </td><td> '.$userMsg.'</td>
</tr></table></body></html>';
//$message = "Email id : ".$userEmail. "\r\nPhone No : ".$userPhone."\r\nName : ".$userName."\r\nSays : ".$userMsg;
$to= "Test@Gmail.com" ;
$headers = "From: " . strip_tags($userEmail) . "\r\n";
$headers .= "Reply-To: ". strip_tags($userEmail) . "\r\n";
//$headers .= "CC: susan@example.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
if(!mail($to, $subject, $message, $headers)){
$mail_status='no';
header("Location: index.html");
exit();
}else{
$mail_status='yes';
header("Location: index.html");
exit();
} ?>