Every PHP-MYSQL programmer need to know Anti-SQL Injection. Please take a look at very simple function which can save your database!!
<?php
/*
Online PHP Examples with Source Code
website: http://4evertutorials.blogspot.in/
*/
function ClearInput($dirtyInput){
if (get_magic_quotes_gpc()) {
$clean = mysql_real_escape_string(stripslashes($dirtyInput));
}else{
$clean = mysql_real_escape_string($dirtyInput);
}
return $clean;
}
?>






0 comments:
Post a Comment