Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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>
like image 870
singerng Avatar asked Nov 16 '11 02:11

singerng


2 Answers

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.

like image 72
AbuHuraira Lakdawala Avatar answered Oct 17 '22 06:10

AbuHuraira Lakdawala


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

like image 41
Duke Hall Avatar answered Oct 17 '22 07:10

Duke Hall