Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-10-2012, 03:07 AM   PM User | #1
Remix919
Regular Coder

 
Join Date: Jan 2006
Posts: 193
Thanks: 29
Thanked 0 Times in 0 Posts
Remix919 is an unknown quantity at this point
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?
Remix919 is offline   Reply With Quote
Old 10-10-2012, 03:19 AM   PM User | #2
outspoken
New to the CF scene

 
Join Date: Oct 2012
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
outspoken is an unknown quantity at this point
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.
outspoken is offline   Reply With Quote
Old 10-10-2012, 03:24 AM   PM User | #3
Remix919
Regular Coder

 
Join Date: Jan 2006
Posts: 193
Thanks: 29
Thanked 0 Times in 0 Posts
Remix919 is an unknown quantity at this point
Quote:
Originally Posted by outspoken View Post
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
Remix919 is offline   Reply With Quote
Old 10-10-2012, 04:34 AM   PM User | #4
DrDOS
Senior Coder

 
Join Date: Sep 2010
Posts: 1,146
Thanks: 10
Thanked 148 Times in 148 Posts
DrDOS is infamous around these parts
Yes, it will ignore the # as that is used to pass information to the
HTML of the page.
DrDOS is offline   Reply With Quote
Old 10-10-2012, 05:06 AM   PM User | #5
firepages
Super Moderator


 
Join Date: May 2002
Location: Perth Australia
Posts: 3,890
Thanks: 5
Thanked 79 Times in 78 Posts
firepages will become famous soon enough
Quote:
Originally Posted by Remix919 View Post
Ok, lol, I had though of something like that using a string replace, was hoping there was an easier solutions though

not easier as such but the `normal` way around this is to urlencode()/urldecode() or base64_encode()/base64_decode() the variable
__________________
resistance is...

MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)
firepages is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:46 AM.


Advertisement
Log in to turn off these ads.