CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   PHP (http://www.codingforums.com/forumdisplay.php?f=6)
-   -   How to GET # symbol in URL? (http://www.codingforums.com/showthread.php?t=275959)

Remix919 10-10-2012 03:07 AM

How to GET # symbol in URL?
 
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 03: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 03:24 AM

Quote:

Originally Posted by outspoken (Post 1278214)
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 04:34 AM

Yes, it will ignore the # as that is used to pass information to the
HTML of the page.

firepages 10-10-2012 05:06 AM

Quote:

Originally Posted by Remix919 (Post 1278216)
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() or base64_encode()/base64_decode() the variable


All times are GMT +1. The time now is 06:20 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.