Jump to content

Help with POST


aeroswat

Recommended Posts

Unfortunately, yes. The magic_quotes_gpc setting being ON will cause GET, POST, and COOKIE data to be 'magically' escaped, even if you don't want it to be.

 

You either need to turn the magic_quotes_gpc setting off (it is settable on a PHP_INI_PERDIR basis) or if you cannot turn it off you must use the get_magic_quotes_gpc() function to test if it is on and then use stripslashes() on the data to remove the offending \ characters. You could unconditionally use stripslashes() on the data but that would prevent you from ever having a real \ as part of the data if magic_quotes_gpc is off.

Link to comment
https://forums.phpfreaks.com/topic/190538-help-with-post/#findComment-1004979
Share on other sites

Unfortunately, yes. The magic_quotes_gpc setting being ON will cause GET, POST, and COOKIE data to be 'magically' escaped, even if you don't want it to be.

 

You either need to turn the magic_quotes_gpc setting off (it is settable on a PHP_INI_PERDIR basis) or if you cannot turn it off you must use the get_magic_quotes_gpc() function to test if it is on and then use stripslashes() on the data to remove the offending \ characters. You could unconditionally use stripslashes() on the data but that would prevent you from ever having a real \ as part of the data if magic_quotes_gpc is off.

 

Ty. Just didn't know if POST was supposed to do that. I went ahead and added the stripslashes to the individual area that required it

Link to comment
https://forums.phpfreaks.com/topic/190538-help-with-post/#findComment-1004981
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.