get_magic_quotes_gpc()

get_magic_quotes_gpc()

If magic_quotes_gpc is on in php.ini, php will automatically add slashes to the post data. It is basically for security purpose.However, slashes in your scripts can wreak havoc. Following code will show you how to deal those things

if (get_magic_quotes_gpc()) {
if (is_array($_POST) {
$_POST = array_map('stripslashes',$_POST);
}
}

In the above code array_map function call stripslashes function to strip the all the datas in $_POST array.

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.