6

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>
3
  • 3
    In what way is it not working? Commented Nov 16, 2011 at 2:14
  • What does your send.php script file look like? Btw, you can't use google.com as your action. It sounds like your send.php file must be set up incorrectly. Commented Nov 16, 2011 at 2:14
  • How's about posting your send.php code? Also, you have some just plain bad html there. it's <br />, not </br> and in html5 just <br>. You have no "value" attributes in your form elements. Your form has no ID, which sort of doesn't matter but it;s supposed to. and if it is xhtml it should have at least one fieldset in there to be "valid". also, input is self closing. get rid of the </input> tags Commented Nov 16, 2011 at 2:18

3 Answers 3

6

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

-1

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.