hi all i am after blocking a device on my site here is the coding that i need the device blocking
this is me blocked.php
this is my blocked2.php
please could some one help me fix it please i put this $var[6] = 'MOT-W377'; and members with that device can still get on my sites
this is me blocked.php
Code:
<?php
$mobile = "blocked2.php";
$text = $_SERVER['HTTP_USER_AGENT'];
$var[1] = 'anonymouse.org';
$var[2] = 'Mozilla/4.0 (compatible; MSIE 6.0; Symbian OS; Series 60';
$var[3] = 'http://www.verkata.com';
//$var[4] = 'J2ME';
//$var[5] = 'Opera Mini246/';
$var[6] = 'MOT-W377'; <-----what i want blocked
$result = count($var);
for ($i=0;$i<$result;$i++)
{
$ausg = stristr($text, $var[$i]);
if(strlen($ausg)>0)
{
header("location: $mobile");
echo '<BR>java/opera mini browser detected<BR>';
break;
}
}
?>
Code:
<?php
/*
www.wapdesire.com
*/
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
//header('Content-type: application/vnd.wap.xhtml+xml');
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\" \"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">";
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<?php
echo "<head>";
echo "<title>Error!</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/white_medium.css\">";
echo "</head>";
echo "<body>";
echo "<p align=\"center\">";
echo "<img src=\"../images/notok.gif\" alt=\"\"/><br/>";
echo "<b>Error!!! Login Failed...</b><br/><br/>";
echo "This error happens usually when Using java/opera mini or another blocked browser<br/><br/>";
echo "<b>pls use ur mobiles main browser</b>";
echo "</p>";
echo "</body>";
echo "</html>";
?>

Comment