note 97716 added to function.addslashes

From: Date: Tue, 04 May 2010 20:46:46 +0000
Subject: note 97716 added to function.addslashes
Groups: php.notes 
Request: Send a blank email to php-notes+get-168938@lists.php.net to get a copy of this message
Heres a hassle free function to use to check your query string and before its handed to the db. It will add/remove slashes according to the get_magic_quotes_gpc state function mysql_prep($value) { if(get_magic_quotes_gpc()){ $value = stripslashes($value); } else { $value = addslashes($value); } return $value; } ---- Server IP: 69.147.83.197 Probable Submitter: 81.109.107.83 ---- Manual Page -- http://www.php.net/manual/en/function.addslashes.php Edit -- https://master.php.net/note/edit/97716 Del: integrated -- https://master.php.net/note/delete/97716/integrated Del: useless -- https://master.php.net/note/delete/97716/useless Del: bad code -- https://master.php.net/note/delete/97716/bad+code Del: spam -- https://master.php.net/note/delete/97716/spam Del: non-english -- https://master.php.net/note/delete/97716/non-english Del: in docs -- https://master.php.net/note/delete/97716/in+docs Del: other reasons-- https://master.php.net/note/delete/97716 Reject -- https://master.php.net/note/reject/97716 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#168938) next »