Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
HTML表单PHP帖子不起作用_Php_Html_Forms_Post_Form Submit - Fatal编程技术网

HTML表单PHP帖子不起作用

HTML表单PHP帖子不起作用,php,html,forms,post,form-submit,Php,Html,Forms,Post,Form Submit,我正在为自己写一个小网站,我遇到了一个看似简单的代码行的问题: form action="send.php" method="post" 此外,即使是像formaction=”这样的简单行http://www.google.com“>不起作用。这是我的密码: <html> <head> <title> AnonMail! </title> </hea

我正在为自己写一个小网站,我遇到了一个看似简单的代码行的问题:

form action="send.php" method="post"
此外,即使是像
formaction=”这样的简单行http://www.google.com“>
不起作用。这是我的密码:

<html>  
    <head>  
        <title>  
            AnonMail!  
        </title>  
    </head>  
    <body style="font-family:'Tahoma';>  
        <form action="send.php" method="post">  
            <label for="from">From:  </label><input type="text" name="from" id="from"></input></br>  
            <label for="to">To:  </label><input type="text" name="to" id="to"></input></br>  
            <label for="subj">Subject:  </label><input type="text" name="subj" id="subj"></input></br>  
            <textarea rows=10 cols=100 name="message"></textarea></br>  
            <input type="submit" value="Send"/>  
        </form>  
    </body>  
</html>

阿诺梅尔!

以下是一个应该有效的表单:

<html>
<body>
<form action="contact.php" method="post">
<p><b>Your Name:</b> <input type="text" name="yourname" /><br />
<b>Subject:</b> <input type="text" name="subject" /><br />
<b>E-mail:</b> <input type="text" name="email" /><br />
Website: <input type="text" name="website"></p>   
<p><input type="submit" value="Send it!"></p>
</form>
</body>
</html>

您的姓名:
主题:
电子邮件:
网站:


如果您仍然有问题:

当您的操作引用外部源时,浏览器会显示警告。有些浏览器根本不发布表单。这对用户来说是不安全的。

错误从您的body标签开始。
您尚未在正文的样式标记中关闭双引号。
只需正确关闭它,然后运行它。

我认为这只是问题所在。

它以什么方式不起作用?send.php脚本文件是什么样子的?顺便说一句,你不能使用google.com作为你的行动。听起来你的send.php文件设置不正确。发布你的send.php代码怎么样?此外,您还有一些非常糟糕的html。它是
,而不是
,在html5中只是
。表单元素中没有“值”属性。你的表单没有ID,这不重要,但它;应该是的。如果它是xhtml,那么其中至少应该有一个字段集是“有效的”。此外,输入是自动关闭的。去掉标签