简体   繁体   中英

HTML form PHP post not working

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>

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM