我已经制作了一个PHP复选框表单,该表单应该向我发送一封电子邮件,其中包含所选选项和textarea字段中的文本。问题是我是PHP复选框表单的新手(这是我第一次尝试这样的尝试),并且在点击提交按钮时给了我一些错误。我安装了xampp并且服务器处于活动状态,* .php位于htdocs中,所以它不是因为这些东西。希望您能够帮助我。
<?php
$to = "[my real email]";
$subject = "Shop request:"; ;
$language = $_REQUEST['i'] ;
$message = $_REQUEST['message'] ;
$details =
"Subject: $subject\n
Item: $i \n
Message: $message \n
";
ini_set("sendmail_from", $email);
$ok = mail($to, $subject, $message);
if ($ok) {
echo "<p>Mail sent!</p>";
} else {
echo "<p>Mail could not be sent. Sorry!</p>";
}
?>
<form action="http://localhost/contactus.php" method="post" enctype="multipart/form-data">
<br>
<table width="58%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="1" align="left" valign="middle">Items:</td>
<td align="left">
<input type="checkbox" name="i[]" value="B1">B1
<input type="checkbox" name="i[]" value="B2">B2
<input type="checkbox" name="i[]" value="B3">B3 </td>
</tr>
<tr>
<td height="40" align="left" valign="middle">Adress:</td>
<td align="left"><label for="message"></label>
<textarea name="message" id="message" cols="45" rows="5"></textarea></td>
</tr>
<tr>
<td height="40" align="left"> </td>
<td align="left"><input type="submit" value="Send" /> </tr>
</table>
</form>