[SOLVED] method="post" turns to get

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Archy
Forum Contributor
Posts: 129
Joined: Fri Jun 18, 2004 2:25 pm
Location: USA

[SOLVED] method="post" turns to get

Post by Archy »

Well, the topic explains it really, I am using the command:

Code: Select all

<form action="home.php" action="post">
...
...
</form>
Yet all the variables get passed through the URL instead of the POST variable. I have tried print_r($_POST), nothing is echo'd (apart from Array ( ) ), howeverm it echo's out the inputs successfully when I use print_r($_GET).

Anyone know what the problem is, this has happened to me a couple of times over the past couple of months, even though I use the form tag hundreds of times, 95% working correctly.

Thanks
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Re: method="post" turns to get

Post by n00b Saibot »

Archy wrote:

Code: Select all

<form action="home.php" action="post">
...
...
</form>
Yet all the variables get passed through the URL instead of the POST variable.
You never set the method anmywhere you just specified the action i.e. the recieving file. you should change

Code: Select all

<form action="home.php" action="post">
to

Code: Select all

<form action="home.php" method="post">
that's it! :lol:
Archy
Forum Contributor
Posts: 129
Joined: Fri Jun 18, 2004 2:25 pm
Location: USA

Post by Archy »

/me slaps head
Post Reply