blocking a device

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    blocking a device

    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
    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;
    }
    
    }
    ?>
    this is my blocked2.php

    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>";
    ?>
    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
    HELP THEM WHO HELPS YOU



    i only work on wapdesire v_2 coding only

    #2
    change $var[6] = 'MOT-W377'; to $var[4] = 'MOT-W377';

    Comment


      #3
      u got var4 and var5 with // so it should be 4 not 6 .
      Wapchat4u


      Topsites4u

      Comment

      Working...
      X