Page 1 of 1

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

Posted: Wed Jan 19, 2005 6:21 pm
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

Posted: Wed Jan 19, 2005 7:53 pm
by feyd
it's called urlencoding..

Posted: Wed Jan 19, 2005 8:11 pm
by myleow
WAH?! So basically i can't use those character in $_GET variables? $_POST works fine though.

Posted: Wed Jan 19, 2005 8:12 pm
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.