Coombes
Coombes

Reputation: 203

Issue with HTML form

I'm having a slight issue with the following piece of code:

<form action="submit.php" action="POST">
    Name: <input type="text" name="name"><br>
    <input type="submit" value="Add Card!">
</form>

Basically when I'm hitting submit it's going to the URL:

http://localhost/submit.php?name=Mike

For example rather than just submit.php, I was under the impression that using POST as the method would pass it along through HTTP rather than the URL, I was wondering why this was happening.

Upvotes: 0

Views: 56

Answers (2)

Coombes
Coombes

Reputation: 203

Sorry for the silly question, long day, I was using action="post" instead of method="post".

Feel a tad silly now...

Upvotes: 2

xdazz
xdazz

Reputation: 160833

This will happen if you redirect to http://localhost/submit.php?name=Mike after dealing with the post data.

Upvotes: 0

Related Questions