RE: [PHP] Decoding a URL without decoding values

2004-03-22 Thread Ford, Mike [LSS]
On 21 March 2004 16:03, Ben Ramsey wrote:

> I've got a querystring that looks like this:
> ?url=http%3A%2F%2Ftest.alpharetta.ga.us%2Findex.php%3Fm%3Dlink
> s%26category%3DRecreation%2B%2526%2BParks%26go.x%3D22%26go.y%3D7
> 
> As you can gather, I'm trying to pass a URL to another script
> for some
> processing.  Before I urlencode() the URL and pass it to the query
> string, it looks like this: 
> 
> http://test.alpharetta.ga.us/index.php?m=links&category=Recrea
> tion+%26+Parks&go.x=22&go.y=7 
> 
> As you can see, there are already encoded entities in the
> URL, which are
> further encoded when passed through urlencode().  The problem
> I'm having
>   is that when I urldecode() the string from $_GET["url"], I get the
> following string: 

Don't.  GET values are automatically urldecoded once by the Web server
before they ever reach your script.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Decoding a URL without decoding values

2004-03-21 Thread Ben Ramsey
JW> You can base64_encode() it.

Hadn't thought of that.  Works perfect!  Thanks!

--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Decoding a URL without decoding values

2004-03-21 Thread Jason Wong
On Monday 22 March 2004 00:03, Ben Ramsey wrote:

[snip]

> Is there a way to urldecode() $_GET["url"] and still retain its original
> encoded entities so that I can use it again as a valid URL?

You can base64_encode() it.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
He who laughs last is probably your boss.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php