Forum Moderators: open
But when it gets to script.php the variables are part of the POST set instead of the GET set like they should be. This only happens in Safari. FF and IE work correctly.
Any thoughts on why this is happening?
And I can rewrite the backend to use the post data, but that doesn't make sense to do if I don't have to.
Could it be some type of encoding issue? I made sure that the & was &, but is there an entity for ? as well that I should be using?
I did read about some problems with Safari's XHR implementation, that it doesn't handle POST properly... that seems like an unrelated issue. Or is it?
does the URL of the destination page (once you land on it, ie in the address bar) show the querystring? has it been stripped or truncated?
Also confirm if there are any server-side redirects happening between the window.location execution and the request for the destination page; handling scripts, stuff in the .htaccess, anything that would interfere with going normally from one page to another.
does this also happen when you do a plain <a href="script.php?a=1&b=2"> ?
I don't have Safari installed, so I'm just guessing
a print_r() of all your $_SERVER, $_GET and $_POST variables might also shed some light on what's going on.
a print_r() of all your $_SERVER, $_GET and $_POST variables might also shed some light on what's going on.
The window.location call is going to script.php?a=1&b=2. Only script.php shows up in the address bar. When I do the print_r is shows $_POST['a']=1 and $_POST['b']=2.
And I've Googled just about every combination of terms I can think of to try and find someone else that has something similar happen. No luck though.
[edited by: Nutter at 5:18 pm (utc) on May 15, 2008]
The image that was being used to trigger the JS onclick was <input type="image"> and I forgot to put a return false; after the window.location call so the form was being submitted which was a post request. Similar variable names so I just missed the one variable that's different between the form submitting and the javascript call. Same script, different action.
That's about 3 hours of searching and trying different things for what turned out to be 13 characters.