我的联系表出现错误。我不太熟悉 PHP,所以这里是我为 PHP 和 HTML 编写的代码。
的HTML:
<form name="contactform" method="post" action="sendmail.php" align="center">
<table width="450px" id="black2" style="background-color:#fff" align="center">
</tr>
<tr>
<td valign="top" id="black2"style="background-color:#fff">
<label for="first_name" >First Name *</label>
</td>
<td valign="top"id="black2">
<input type="text" name="first_name" maxlength="50" size="30" id="black2">
</td>
</tr>
<tr>
<td valign="top"" id="black2">
<label for="last_name" id="black2">Last Name *</label>
</td>
<td valign="top">
<input type="text" name="last_name" maxlength="50" size="30">
</td>
</tr>
<tr>
<td valign="top">
<label for="email">Email Address *</label>
</td>
<td valign="top">
<input type="text" name="email" maxlength="80" size="30">
</td>
</tr>
<tr>
<td valign="top">
<label for="telephone">Telephone Number</label>
</td>
<td valign="top">
<input type="text" name="telephone" maxlength="30" size="30">
</td>
</tr>
<tr>
<td valign="top">
<label for="comments">Comments *</label>
</td>
<td valign="top">
<textarea name="comments" maxlength="1000" cols="24" rows="6"></textarea>
</td>
</tr>
<tr>
<td colspan="2" style="text-align:center">
<input type="submit" value="Submit">
</td>
</tr>
</table>
这是PHP:
<?php
$first_name = $_REQUEST['email'];
$last_name = $_REQUEST['last_name'];
$email = $_REQUEST['email'];
$telephone = $_REQUEST['telephone'];
$comments = $_REQUEST['comments'];
mail("mail@mywebsite.co.za","Feedback Form Results", $comments, $telephone, $first_name,
$last_name, "From: $email");
header( "Location: http://www.mywebsite.co.za/thankyou.html" );
?>
出现的错误是:
Warning: mail() expects at most 5 parameters, 7 given in /home/wwwzeetu/public_html/sendmail.php on line 13
Warning: Cannot modify header information - headers already sent by (output started at /home/wwwzeetu/public_html/sendmail.php:13) in /home/wwwzeetu/public_html/sendmail.php on line 14