[SOLVED] Linux automatically adding slashes
Posted: Wed Jul 06, 2005 10:30 pm
Hi
I've come across this many times.
Im coding on WinXP (Apache) and uploading the scripts to a Linux Server.
If I send some data in the form of GET Linux is automatically adding slashes for which I have to do $_GET['a'] = stripslashes($_GET['a'])
test.php?a=h7w%C9%C2%22%26%C2N%7C%E5w%ED5
echo $_GET['a'];
On WinXP
On the Server (Linux)
" converted to \"
All this time I thought that I'll need to use stripslashes() only after doing addslashes().
But now it seems I'll need to stip them even when I dont add them because Linux is adding them automatically.
What if the original string is h7wÉÂ\"&ÂN|åwí5 ?
stripslashes will work in Linux as the string will be h7wÉÂ\\\"&ÂN|åwí5 and the final string will be h7wÉÂ\"&ÂN|åwí5
But the same code on Windows will have the final string as h7wÉÂ"&ÂN|åwí5 getting rid of the \
Any idea on this ?
Thanks
I've come across this many times.
Im coding on WinXP (Apache) and uploading the scripts to a Linux Server.
If I send some data in the form of GET Linux is automatically adding slashes for which I have to do $_GET['a'] = stripslashes($_GET['a'])
test.php?a=h7w%C9%C2%22%26%C2N%7C%E5w%ED5
echo $_GET['a'];
On WinXP
Code: Select all
h7wÉÂ"e;&ÂN|åwí5Code: Select all
h7wÉÂ\"e;&ÂN|åwí5All this time I thought that I'll need to use stripslashes() only after doing addslashes().
But now it seems I'll need to stip them even when I dont add them because Linux is adding them automatically.
What if the original string is h7wÉÂ\"&ÂN|åwí5 ?
stripslashes will work in Linux as the string will be h7wÉÂ\\\"&ÂN|åwí5 and the final string will be h7wÉÂ\"&ÂN|åwí5
But the same code on Windows will have the final string as h7wÉÂ"&ÂN|åwí5 getting rid of the \
Any idea on this ?
Thanks