Forum Moderators: coopster & phranque

Message Too Old, No Replies

Query string disappears by itself from the address bar!

Script works fine if I print text/html instead of print location

         

MichaelBluejay

1:46 pm on Dec 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I load my file <approve.cgi?x12> in my browser, and then this is supposed to happen:

> Grab the query string.
> Report an error if the query string is blank
> Edit some records in a mySQL database
> Redirect to another page with print "Location:newpage.cgi\n\n";

The weird thing is, as <approve.cgi?x12> starts to load in the browser, the query string (the "?x12" part), disappears straight from the address bar by itself! And I get the error that says the query string is blank.

I find that I can prevent this problem if I remove the redirect at the end of the script and print anything to the browser window instead. Then the address bar stays on the full url with the query string and no error is reported.

Maybe this is expected behavior, but it sure seems weird to me! Anyone know why this is happening, and more importantly, how I can get my query string to stay put? Thanks for your help.

rocknbil

7:56 pm on Dec 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Got code? :-)

Try breaking down the operational parts of your script to just the few elements that are giving you grief and running that on it's own and paste it here and let's have a look.

I suspect that it's not exiting when you think it should, but that doesn't explain the disappearing location field.

MichaelBluejay

12:40 am on Dec 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I don't believe I did this....

My <print "Location..." was pointing to the SAME script that was running it. So after executing successfully, it got called again without any query string. But of course I couldn't see that, all I could see was that the query string was "disappearing".

Tee-hee, I'm a moron!

Wish I could delete this thread...