【发布时间】:2011-12-30 01:20:49
【问题描述】:
我正在为自己编写一个小网站,但我遇到了看似简单的代码行的问题:
form action="send.php" method="post"
此外,即使像form action="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>
【问题讨论】:
-
在什么情况下不工作?
-
您的 send.php 脚本文件是什么样的?顺便说一句,您不能使用 google.com 作为您的操作。听起来您的 send.php 文件必须设置不正确。
-
发布您的 send.php 代码怎么样?此外,您那里有一些简单的坏 html。它是
,而不是 ,在 html5 中只是
。您的表单元素中没有“值”属性。您的表单没有 ID,这无关紧要,但应该如此。如果它是 xhtml,它应该至少有一个字段集是“有效的”。此外,输入是自动关闭的。摆脱 标签
标签: php html forms post form-submit