...

View Full Version : How to GET # symbol in URL?



Remix919
10-10-2012, 04:07 AM
I'm trying to get a variable from a URL, for example index.php?user=abc#123, but when I try to GET or REQUEST the variable $user from the URL, it just shows up as "abc". Is there anyway to get the entire string?

outspoken
10-10-2012, 04:19 AM
The longshot would be to replace the # with something unique that will actually pass, then reverse it on the other side.

swap # for LOL and send it through as index.php?user=abcLOL123

then replace LOL with #

as, I said, longshot.

Remix919
10-10-2012, 04:24 AM
The longshot would be to replace the # with something unique that will actually pass, then reverse it on the other side.

swap # for LOL and send it through as index.php?user=abcLOL123

then replace LOL with #

as, I said, longshot.

Ok, lol, I had though of something like that using a string replace, was hoping there was an easier solutions though :D

DrDOS
10-10-2012, 05:34 AM
Yes, it will ignore the # as that is used to pass information to the
HTML of the page.

firepages
10-10-2012, 06:06 AM
Ok, lol, I had though of something like that using a string replace, was hoping there was an easier solutions though :D


not easier as such but the `normal` way around this is to urlencode()/urldecode() (http://php.net/manual/en/function.urlencode.php) or base64_encode()/base64_decode() (http://www.php.net/manual/en/function.base64-decode.php)the variable



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum