HTML 表单 PHP 帖子不起作用

sin*_*rng 5 html php forms post form-submit

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

form action="send.php" method="post"
Run Code Online (Sandbox Code Playgroud)

此外,即使是一条简单的线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>
Run Code Online (Sandbox Code Playgroud)

Abu*_*ala 5

错误从您的 body 标签开始。
你没有在你的 body 的 style 标签中关闭你的双引号。
只需正确关闭它,然后运行它。
我认为这只是问题所在。


小智 1

这是一个应该有效的表格:

<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>
Run Code Online (Sandbox Code Playgroud)

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