HELP: odd "GET" querystring behaviour!

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
kennaasoft
Forum Newbie
Posts: 2
Joined: Sun Jan 13, 2008 11:05 am

HELP: odd "GET" querystring behaviour!

Post by kennaasoft »

I encountered a disturbing situation while coding a javascript-submitted form; i submit a form (using javascript: form.submit()) with the "GET" method, with the action set to something like:

Code: Select all

add_to_cart.php?prodid=16&qty=6
but i end up with

Code: Select all

add_to_cart.php?qty=6
after submitting, which breaks my script (with the first value cut off).
I must confess, I'm quite lost as to why this should happen.
Another odd thing is, if i set these values as hidden fields and submit the form using the "POST" method, everything works fine! Unfortunately, i can't use POST, since some of my javascript/AJAX functions depend on the query string.

If there is anyone out there who can help, i'd really appreciate it. :?:
User avatar
jimthunderbird
Forum Contributor
Posts: 147
Joined: Tue Jul 04, 2006 3:59 am
Location: San Francisco, CA

Re: HELP: odd "GET" querystring behaviour!

Post by jimthunderbird »

I think it might be something missing on your form submit. Also, did you check if you set the form action correctly in your javascript? If possible I would want to see the code snippet in order to determine the problem.
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: HELP: odd "GET" querystring behaviour!

Post by Jonah Bron »

I think we need to see the source to diagnose you problem. :D
Post Reply