HTML 表单 PHP 帖子无法正常工作
我正在为自己编写一个小网站,但我在看似简单的代码行上遇到了麻烦:
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>
I'm writing a little website for myself and I'm having trouble with what seems like a simple line of code:
form action="send.php" method="post"
Furthermore, even a simple line like form action="http://www.google.com">
isn't working. Here is my code:
<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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
错误以您的正文标记开始。
您尚未在正文的样式标签中关闭双引号。
只需正确关闭它,然后运行它即可。
我认为这只是问题所在。
The error starts with your body tag.
You have not closed your double quotes in the style tag of your body.
Just close it properly and then run it.
I think that is only the problem.
这是一个应该可以使用的表单:
如果您仍然遇到问题:http://myphpform。 com/php-form-not-working.php
Here's a form that should work:
If you're still having troubles: http://myphpform.com/php-form-not-working.php
当您的操作引用外部源时,浏览器会显示警告。有些浏览器根本不发布表单。这对用户来说是不安全的。
browsers show warnings when your action refers to an external source. Some browsers do not post form at all. This is unsafe for users.