Passing as POST and GET

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Passing as POST and GET

Post 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 :)
User avatar
AKA Panama Jack
Forum Regular
Posts: 878
Joined: Mon Nov 14, 2005 4:21 pm

Post by AKA Panama Jack »

The code variable will be passed as $_GET['code'] and the test1 variable will be passed as $_POST['test1'].
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

it will be compatible with everything :-P that's quite a normal looking form
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Post 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.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post 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.
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post 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.
Post Reply