شرح حماية سكربتات PHP


 

هذي هي الدوال:

/*
* sweilem aljuhani
* www.sweilemj.com
*/

function save($vars){

$vars = trim($vars);

$vars = addslashes($vars);

$vars = htmlspecialchars($vars);

$vars = stripslashes($vars);

$vars = strip_tags($vars);

return $vars;

}

#########################
function save2($getandpost)
{
$getandpost = htmlspecialchars($getandpost);

$getandpost = str_replace(“select”,””,$getandpost);

$getandpost = str_replace(“union”, “”, $getandpost);

$getandpost = str_replace(“update”,””,$getandpost);

$getandpost = str_replace(“insert”,””,$getandpost);

$getandpost = str_replace(“where”,””,$getandpost);

$getandpost = str_replace(“like”,””,$getandpost);

$getandpost = str_replace(“or”,””,$getandpost);

$getandpost = str_replace(“and”,””,$getandpost);

$getandpost = str_replace(“set”,””,$getandpost);

$getandpost = str_replace(“into”,””,$getandpost);

$getandpost = str_replace(“‘”, “”, $getandpost);

$getandpost = str_replace(“;”, “”, $getandpost);

$getandpost = str_replace(“>”, “”, $getandpost);

$getandpost = str_replace(“<“, “”, $getandpost);

$getandpost = str_replace(“*”, “”, $getandpost);

$getandpost = strip_tags($getandpost);

return $getandpost;
}

 

label, ,