使用PHP的网页联系表错误:{“代码”:“ MethodNotAllowedError”,“消息”:“不允许发布”}

问题描述 投票:0回答:1

所以我使用了代码:

<form action="../scripts/mail.php" method="POST">
<p>Name</p> <input type="text" name="name">
<p>Email</p> <input type="text" name="email">
<p>Message</p><textarea name="message" rows="6" cols="25"></textarea><br />
<input type="submit" value="Send"><input type="reset" value="Clear">
</form>

并且链接的php文件为

<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent=" From: $name \n Phone: $phone Message: $message";
$recipient = "[email protected]";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!" . " -" . "<a href='form.html' style='text-decoration:none;color:#ff0099;'> Return Home</a>";
?>

测试时的错误是:{“代码”:“ MethodNotAllowedError”,“消息”:“不允许发布”]

我在做什么错?

php html forms contacts
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.