Copy the Code code as follows:
function Jk1986_checksql ()
{
$bad _str = "and|select|update|" | Delete|insert|* ";
$bad _array = explode ("|", $bad _STR);
/** Filter Get Parameters **/
foreach ($bad _array as $bad _a)
{
foreach ($_get as $g)
{
if (Substr_count (Strtolower ($g), $bad _a) > 0)
{
echo "";
Exit ();
}
}
}
/** Filter Post Parameters **/
foreach ($bad _array as $bad _a)
{
foreach ($_post as $p)
{
if (Substr_count (Strtolower ($p), $bad _a) > 0)
{
echo "";
Exit ();
}
}
}
/** Filter Cookies parameter **/
foreach ($bad _array as $bad _a)
{
foreach ($_cookie as $co)
{
if (Substr_count (Strtolower ($co), $bad _a) > 0)
{
echo "";
Exit ();
}
}
}
}
Oh like ASP and ASP, the purpose is to let lazy to improve efficiency. 88
The above describes the Windows tablet recommended PHP Universal Anti-injection program recommendations, including the Windows tablet recommended content, I hope to be interested in PHP tutorial friends helpful.