HTML 表单 PHP 帖子无法正常工作

发布于 2024-12-15 23:35:08 字数 1044 浏览 0 评论 0原文

我正在为自己编写一个小网站,但我在看似简单的代码行上遇到了麻烦:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

廻憶裏菂餘溫 2024-12-22 23:35:08

错误以您的正文标记开始。
您尚未在正文的样式标签中关闭双引号。
只需正确关闭它,然后运行它即可。
我认为这只是问题所在。

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.

最后的乘客 2024-12-22 23:35:08

这是一个应该可以使用的表单:

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

如果您仍然遇到问题:http://myphpform。 com/php-form-not-working.php

Here's a form that should work:

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

If you're still having troubles: http://myphpform.com/php-form-not-working.php

阿楠 2024-12-22 23:35:08

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

browsers show warnings when your action refers to an external source. Some browsers do not post form at all. This is unsafe for users.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文