PHP联系人(405不允许)

时间:2019-05-06 22:39:37

标签: php html

我有我的HTML联系人表格和我的PHP帖子。使用我的网站Live ...提交表单时,我进入“ 405 Not Allowed”页面。我是PHP的新手,现在迷路了。

在一些在线教程之后...有一个index.php。我猜这是单击提交时页面转到的位置。

contact.html:

<form method="post" class="contact-form" action="contactform.php">
                <div class="form_settings">
                    <p><span>Subject</span><input class="contact" type="text" name="subject" value="" /></p>
                    <p><span>Name</span><input class="contact" type="text" name="name" value="" /></p>
                    <p><span>Email Address</span><input class="contact" type="text" name="mail" value="" /></p>
                    <p><span>Message</span><textarea class="contact textarea" rows="8" cols="50" name="message"></textarea></p>
                    <div class="button">
                        <p style="padding-top: 15px"><span>&nbsp;</span><input class="submit" type="submit" name="submit" value="submit" /></p>
                    </div>
                </div>
            </form>

contactform.php:

if (isset($_POST['submit'])){
$name = $_POST['name'];
$subject = $_POST['subject'];
$mailFrom = $_POST['mail'];
$message = $_POST['message'];

$mailTo = "xxxxxxxx@yahoo.com";
$headers = "Form: ".$mailFrom;
$txt = "You have received an E-mail from ".$name.".\n\n".$message;

mail($mailTo, $subject , $message, $headers);
header("Location: index.php?mailsend");

index.php

     <?php 
echo "Hello world!"; 
?>

0 个答案:

没有答案