/ Published in: Other
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function mysql_prep($value) { $magic_quotes_active = get_magic_quotes_gpc(); $new_enough_gpc = function_exists("mysql_real_escape_string"); // i.e, PHP >= v4.3.0 if ($new_enough_gpc) { if($magic_quotes_active) {$value = stripslashes($value);} $value = mysql_real_escape_string($value); } else { if (!$magic_quotes_active) {$value = addslashes($value);} } return $value; }