note 81674 added to function.get-magic-quotes-gpc
| From: | dot dot dot dot dot alexander at gmail dot com | Date: | Sun, 09 Mar 2008 14:51:57 +0000 |
| Subject: | note 81674 added to function.get-magic-quotes-gpc | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136866@lists.php.net to get a copy of this message | ||
If you don't need to enter the user input in a database, and you are annoyed by
"those-damn-slashes-behind-the-apostrophes" (or quotes), that you are forced to strip
manually for each entry, you will find this helpful: ( Just put it so it gets executed before any
manipulation to the GPC ( Get|Post|Cookie ) )
<?php
if( ( function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc() ) ||
ini_get('magic_quotes_sybase') ){
foreach($_GET as $k => $v) $_GET[$k] = stripslashes($v);
foreach($_POST as $k => $v) $_POST[$k] = stripslashes($v);
foreach($_COOKIE as $k => $v) $_COOKIE[$k] = stripslashes($v);
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 87.120.68.77
----
Manual Page -- http://www.php.net/manual/en/function.get-magic-quotes-gpc.php
Edit -- https://master.php.net/note/edit/81674
Del: integrated -- https://master.php.net/note/delete/81674/integrated
Del: useless -- https://master.php.net/note/delete/81674/useless
Del: bad code -- https://master.php.net/note/delete/81674/bad+code
Del: spam -- https://master.php.net/note/delete/81674/spam
Del: non-english -- https://master.php.net/note/delete/81674/non-english
Del: in docs -- https://master.php.net/note/delete/81674/in+docs
Del: other reasons-- https://master.php.net/note/delete/81674
Reject -- https://master.php.net/note/reject/81674
Search -- https://master.php.net/manage/user-notes.php