$_GET['+'] == space?? HELP!

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
myleow
Forum Contributor
Posts: 194
Joined: Mon Jun 21, 2004 7:05 pm
Location: California

$_GET['+'] == space?? HELP!

Post by myleow »

I have Magic Quote on for PHP 5.0.2 and it helps alot, but i notice recently that # & " characters becomes NULL or just disappears. The + character turns in to a space.

This is so weird, has anyone experienced this problem before?

Basically this is what i have

Code: Select all

echo "Testing ==>";
echo $_GETї'view'];
echo "<==";
Result is Testing ==><==
The above might be expected (correct me if i am wrong), but what i got from + is unexpected.

Code: Select all

echo "Testing ==>";
echo $_GET&#1111;'view'];
echo "<==";
Result is Testing ==> <==
A space appeared in the place of + which is very weird. Remember Magic Quote is ON and i do need it for other stuff.

Anyone encountered this before and know how to fix it?

Regards
Mian
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it's called urlencoding..
myleow
Forum Contributor
Posts: 194
Joined: Mon Jun 21, 2004 7:05 pm
Location: California

Post by myleow »

WAH?! So basically i can't use those character in $_GET variables? $_POST works fine though.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you can use them, you are supposed to urlencode() any variables as you pass them into the url strings so they don't go screwy. They will be decoded once they reach that page.
Post Reply