In the development, we should pay attention to prevent SQL injection, so in the form submitted to the value to do the corresponding processing, before the data can be updated to the database
PHP annihilation function. Any value can be passed over to convert
Copy CodeThe code is as follows:
function quotes ($content)
{
If Magic_quotes_gpc=off, then start processing
if (!GET_MAGIC_QUOTES_GPC ()) {
Determine if the $content is an array
if (Is_array ($content)) {
If $content is an array, then it is processed by every single
foreach ($content as $key = = $value) {
$content [$key] = addslashes ($value);
}
} else {
If $content is not an array, it is processed only once
Addslashes ($content);
}
} else {
If magic_quotes_gpc=on, then do not deal with
}
Back to $content
return $content;
Use Stripslashes () to remove the backslash when displayed
Stripslashes (), it can be addslashes () processing automatically added to the (backslash) \ Remove
http://www.bkjia.com/PHPjc/327587.html www.bkjia.com true http://www.bkjia.com/PHPjc/327587.html techarticle in the development, we should pay attention to prevent SQL injection, so in the form submitted to the value to do the corresponding processing, before the data can be updated to the database php annihilation function. Any value is ...