Hi friends, I have a chat text wml, would block a hacker who enters with opera and anonymous, and I would block access. I know if there is a function or code to deny access to these browsers? thanks!
$browser = $_SERVER['HTTP_USER_AGENT'];
$opera = substr_count($browser,"opera");
$operabig = substr_count($browser,"Opera");
if(($opera>0)||($operabig>0)||($browser=="")){
echo "Site is Down Please Come back later
";
}else{
//////////do normal site stuff
}
<?php
if(strstr($_SERVER['HTTP_USER_AGENT'], "SonyEricssonK800i/R8BF Browser/NetFront/3.3 Profile/MIDP-2.0 Configuration/CLDC-1.1"))
{
die("**** Off!!!!
Your sister is your mother
Your father is your brother
They like to f*** each other.
The Sarah family…
");
}
$mobile = "blocked2.php";
$text = $_SERVER['HTTP_USER_AGENT'];
$var[1] = 'anonymouse.org';
$var[2] = 'J2ME';
$var[3] = 'Opera Mini246/';
$result = count($var);
for ($i=0;$i<$result;$i++)
{
$ausg = stristr($text, $var[$i]);
if(strlen($ausg)>0)
{
header("location: $mobile");
echo '
java/opera mini browser detected
';
break;
}
}
?>
$mobile = "blocked2.php"; $text = $_SERVER['HTTP_USER_AGENT']; $var[1] = 'anonymouse.org'; $var[2] = 'J2ME'; $var[3] = 'Opera Mini246/';
$var[3] = 'Opera Mini246/';
$var[2] = 'J2ME';

Comment