please help not working

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

    please help not working

    not sure whats wrong with this but its not working
    PHP Code:
    <?php
    header
    ('Content-Type: text/html;charset=utf-8');

    $http=$_SERVER['HTTP_USER_AGENT'];
    if((
    substr($http,0,5)=='Opera' and !strpos($http,'Mini')) 
    or 
    substr($http,0,7)=='Mozilla' 
    or substr($http,0,6)=='Galaxy' 
    or substr($http,0,12)=='AmigaVoyager' 
    or substr($http,0,8)=='CyberDog' 
    or substr($http,0,5)=='Dillo' 
    or substr($http,0,7)=='HotJava' 
    or substr($http,0,15)=='IBM WebExplorer' 
    or substr($http,0,4)=='iCab' 
    or substr($http,0,10)=='LeechCraft' 
    or substr($http,0,5)=='Links' 
    or substr($http,0,4)=='Lynx' 
    or substr($http,0,11)=='NCSA Mosaic' 
    or substr($http,0,7)=='NCSA Mosaic' 
    or substr($http,0,6)=='retawq' 
    or substr($http,0,6)=='Webkit' 
    or substr($http,0,4)=='Uzbl' 
    or substr($http,0,3)=='w3m' 
    or substr($http,0,12)=='WorldWideweb')
    {
    header("Location: http://$_SERVER[SERVER_NAME]/index.html"); //pc
    }else{
    header("Location: http://$_SERVER[SERVER_NAME]/index.php"); //mobile
    }
    ?>
    Last edited by metulj; 21.07.11, 13:25. Reason: use [ php ] tag [ / php ] for posting php code, specially for longer code

    #2
    Its suppose to be a browser detect script. By what I can see its not going to be doing anything else than that and then redirect to a mobile or pc version of ur site meaning u have to have a PC version an mobile version of your site...
    My site: http://mimobifunclub.tk
    sigpic

    Comment


      #3
      so which error is it reporting??? and why dont you use strpos instead of substr,its easier and do the same work???
      PHP Code:
      $("#mfreak").find(".head brain").clone(); 
      Progress:
      Code:
      [|||___________________________] : 5%
      Output:
      Code:
      Memory limit reached, unable to complete operation.
      Support answer:
      Code:
      Try using a super uber strong mega computer to reach at least 10%.

      Comment


        #4
        Here
        PHP Code:
        <?php
        header
        ('Content-Type: text/html;charset=utf-8');

        $http=$_SERVER['HTTP_USER_AGENT'];
        if((
        substr($http,0,5)=='Opera' and !strpos($http,'Mini')) 
        or 
        substr($http,0,7)=='Mozilla' 
        or substr($http,0,6)=='Galaxy' 
        or substr($http,0,12)=='AmigaVoyager' 
        or substr($http,0,8)=='CyberDog' 
        or substr($http,0,5)=='Dillo' 
        or substr($http,0,7)=='HotJava' 
        or substr($http,0,15)=='IBM WebExplorer' 
        or substr($http,0,4)=='iCab' 
        or substr($http,0,10)=='LeechCraft' 
        or substr($http,0,5)=='Links' 
        or substr($http,0,4)=='Lynx' 
        or substr($http,0,11)=='NCSA Mosaic' 
        or substr($http,0,7)=='NCSA Mosaic' 
        or substr($http,0,6)=='retawq' 
        or substr($http,0,6)=='Webkit' 
        or substr($http,0,4)=='Uzbl' 
        or substr($http,0,3)=='w3m' 
        or substr($http,0,12)=='WorldWideweb')
        {
        header('Location: http://'.$_SERVER['SERVER_NAME'].'/index.html'); //pc
        }else{
        header('Location: http://'.$_SERVER['SERVER_NAME'].'/index.php'); //mobile
        }
        ?>
        <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

        Comment

        Working...
        X