dphphvs496524 2019-05-06 22:39
浏览 18

PHP联系人(405 Not Allowed)

I have my HTML contact form and my PHP post. With my website Live... when submitting the form I'm lead to a "405 Not Allowed" page. I'm very new to PHP and I'm lost at this point.

Following some of the online tutorials... there is an index.php. I'm guessing this is where the page goes to when submit is clicked.

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.".

".$message;

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

index.php

     <?php 
echo "Hello world!"; 
?>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
    • ¥20 怎么用dlib库的算法识别小麦病虫害
    • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
    • ¥15 java写代码遇到问题,求帮助
    • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
    • ¥15 有了解d3和topogram.js库的吗?有偿请教
    • ¥100 任意维数的K均值聚类
    • ¥15 stamps做sbas-insar,时序沉降图怎么画
    • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
    • ¥15 关于#Java#的问题,如何解决?