...

View Full Version : Passing Variables in the URL



VegasLarry
10-01-2003, 03:26 PM
OK... I'm lost & confused now. I am trying to pass simple values in the URL from page to page. Of course it works fine in IE with just:
?a=something&b=another
BUT Netscape can't pick up the second value. It does get the first. I notice that here at coding forums the IE string comes through as plain text but when I use NS it is encoded.

None of my reference books explain the encoding thing. Can someone point me to a good explination of making the link as well as decoding it.

I am trying to pass the information back to the same page to do a database query and display dynaminc content.

Thanks
Larry
:confused:

Nightfire
10-01-2003, 03:53 PM
PHP is not clientside, so using a different browser will not affect your coding.

I notice that here at coding forums the IE string comes through as plain text but when I use NS it is encoded.
There's nothing encoded in the urls

Show your code and we'll help from there, but it's nothing to do with browser

bcarl314
10-01-2003, 04:25 PM
Hmm, well maybe it might be.

IE seems to handle spaces in the URL quite well.

example

www.mysite.com/page.php?var1=hello world&var2=foo

The space in "hello world" is often handled in IE, but I have noticed that NN and a few others consider a space to be the end of the URL and do not include anything after that.

I'm sure this is true for other characters as well.

Try to use urlencode before setting a variable. Than should replace all your spaces with %20 which should be ok for ALL browsers.

Alternatively, you could use rawurlencode. Both are in the php documentation.

VegasLarry
10-01-2003, 04:30 PM
Thanks NightFire.

I got it working. I had stray <div> getting called that was covering the output.


Larry

Nightfire
10-01-2003, 04:32 PM
The s=dsfgsdfgsdfwew in the URL is just the session being passed over. If your browser accepts session cookies, then you won't see the s=gdfgdsgsdfds

VegasLarry
10-01-2003, 04:36 PM
Cool.... I was just trying to paste the URL and everytime it would get parsed without the session ID...

Thanks Again
Larry



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum