Hi guys and gals,
I'm trying to use $_REQUEST to pull the value of an encrypted variable back off the URL. The URL looks like this :
http://www.foo.com/blah.php?encrypted=F ... xM5CAYPJwo
and I try to read it using :
$str1=$_REQUEST['encrypted'];
When I try to decrypt this it fails. However, if I put the raw string out of the URL using cut and paste into decrypt algorithm it works perfectly. I've done a comparison between what $_REQUEST gives m and what vut and paste gives me and the 2 strings are below :
Cut and paste
FDUqHR4xCjx4fg8RJDItNxM5CAYPJwo8YRx0QHh7dnd2cH5ZWHQPQQdgfyIaBRY9DiV2EltyB0MDaBtFZ2cEcXdse1lbcxpDA2hpWXlndXV+A3ldKXsBRU5+DQwLIzYtCS52Wlp1DkILa381Jzk3KzN8eVBFdxEyZQsaInhrAwkLYQYoPwF/VXI8PQYvJTEXIjI+BR9/ejJnGxExDnASKjQ1CAYPJ2UWQC01AHcbAxEECQ4tTQFhQWE9KgEmIn8IBhUIIS4GETRaPi01IzJ/dWFyDzoOIUIBVgstFT4jMXhhAgo/PX8=
$_REQUEST
FDUqHR4xCjx4fg8RJDItNxM5CAYPJwo8YRx0QHh7dnd2cH5ZWHQPQQdgfyIaBRY9DiV2EltyB0MDaBtFZ2cEcXdse1lbcxpDA2hpWXlndXV A3ldKXsBRU5 DQwLIzYtCS52Wlp1DkILa381Jzk3KzN8eVBFdxEyZQsaInhrAwkLYQYoPwF/VXI8PQYvJTEXIjI BR9/ejJnGxExDnASKjQ1CAYPJ2UWQC01AHcbAxEECQ4tTQFhQWE9KgEmIn8IBhUIIS4GETRaPi01IzJ/dWFyDzoOIUIBVgstFT4jMXhhAgo/PX8=
As you will see, the + signs in the cut and pasted one have ben converted into CR or LF in the $_REQUEST one. Has anybody any idea how I can get round this please ?
Any help much appeciated
Cheers
Cheesemaker.
Urgent Help Needed Please ! - $_REQUEST Shenanigans
Moderator: General Moderators
-
CHEESEMAKER67
- Forum Newbie
- Posts: 3
- Joined: Thu Jun 15, 2006 9:02 am
Take a look at urlencode() and htmlentities() for solutions.
-
CHEESEMAKER67
- Forum Newbie
- Posts: 3
- Joined: Thu Jun 15, 2006 9:02 am
thanks but..
Thanks for the prompt reply, but I've tried both of those already without success. I've even tried using $_GET instead of $_REQUEST which gave the same result. Surely there must be some way of getting he actual string from a URL...

Maybe just replace any space character with the + sign after the request?
Code: Select all
$str1 = str_replace(" ", "+", $_REQUEST['encrypted']);-
CHEESEMAKER67
- Forum Newbie
- Posts: 3
- Joined: Thu Jun 15, 2006 9:02 am
Thanks
Wow, what a terrible cludge ! A programmer after my own heart 
Even better is that it works !
Thanks very much to both of you who replied to my post. Much appreciated. A virtual pint on me guys !
Cheers
CheeseMaker
Even better is that it works !
Thanks very much to both of you who replied to my post. Much appreciated. A virtual pint on me guys !
Cheers
CheeseMaker