我试过寻找解决方案,但我还没找到一个!这可能是一个简单的错误,但我无法解决。 我根本无法使在线联系表格工作 - 它显示500错误页面。
PHP:
<?php
$myemail = "me@myemail.com";
$name = $_POST['name'];
$phone = $_POST['phone']
$email = $_POST['email'];
$message = $_POST['message'];
$message = "
*MESSAGE FROM ONLINE FORM*
$message
Sent from:
Name: $name
E-mail: $email
Phone: $phone
";
mail($myemail, $name, $phone, $email, $message);
header('Location: http://thewebaddress.co.uk');
?>
HTML:
<div class="contactform">
<form action="sendform.php" method="post">
Name:<br>
<input type="text" name="name" id="name"/ ><br>
Email:<br>
<input type="email" name="email" id="email" /><br/>
Phone:<br/>
<input type="text" name="phone" id="phone" /><br/>
Message:<br/>
<textarea name="message" id="message" ></textarea>
<input type="submit" value="Send Message!" class="button" id="submit" name="submitform" />
</form>
</div>
提前致谢!
答案 0 :(得分:0)
您应该检查是否设置了$ _POST值以及您的邮件调用是否正确。根据文档,它应该是:mail(string $ to,string $ subject,string $ message [,string $ additional_headers [,string $ additional_parameters]])。