Page 1 of 1

Passing as POST and GET

Posted: Tue Nov 22, 2005 11:53 pm
by alex.barylski
If I have a form such as:

Code: Select all

<form action="[b]index.php?code=100[/b]" method="post">
  <input type="text" name="test1" />
  <input type="submit" />
</form>
Will the script that processes this form have access to BOTH $_GET and $_POST data?

Observe the GET data passed in the action attribute, but the FORM is clearly intended to be send as POST.

Would this likely be cross browser compatible? how about on the server side of things???

Just curious...never tried it...but i'm curious :)

Posted: Wed Nov 23, 2005 12:11 am
by AKA Panama Jack
The code variable will be passed as $_GET['code'] and the test1 variable will be passed as $_POST['test1'].

Posted: Wed Nov 23, 2005 6:26 am
by s.dot
it will be compatible with everything :-P that's quite a normal looking form

Posted: Wed Nov 23, 2005 7:00 am
by foobar
scrotaye wrote:it will be compatible with everything :-P that's quite a normal looking form
Not necessarily. Strangely enough, I have found on numerous occasions that sending stuff through GET in a POST form doesn't always work. I suspect it's a browser issue but I can't remember which browser I used for it, probably something old :P . There was one browser I used (it might have been IE5.x) which just ignored the GET parameter for some reason. I'll try to reproduce it, but I'm positive this happened.

Posted: Wed Nov 23, 2005 7:17 am
by patrikG
foobar wrote:
scrotaye wrote:it will be compatible with everything :-P that's quite a normal looking form
Not necessarily. Strangely enough, I have found on numerous occasions that sending stuff through GET in a POST form doesn't always work. I suspect it's a browser issue but I can't remember which browser I used for it, probably something old :P . There was one browser I used (it might have been IE5.x) which just ignored the GET parameter for some reason. I'll try to reproduce it, but I'm positive this happened.
Possible, IE did have some buggy implementation of the HTT-Protocol. I don't remember which version it was, but if you look it up under $_GET and $_POST etc. in the PHP manual there should be a user-note about it.

Posted: Wed Nov 23, 2005 4:27 pm
by shiznatix
do we know which version of IE this is? i do that kind of stuff all the time, i never knew it would have problems with IE.