Looking for script

Discussion in 'Programming' started by weedman420, Jan 10, 2009.

  1. #1
    hi im looking for script that allows users browse my site using only opera or firefox ...
     
    weedman420, Jan 10, 2009 IP
  2. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #2
    Why do you want to kiss off 50% of the marketplace?
     
    Colbyt, Jan 10, 2009 IP
  3. yonghoshin

    yonghoshin Peon

    Messages:
    70
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    <?php echo $_SERVER['HTTP_USER_AGENT']; ?>

    That tells you the user's browser, and you can do appropriate operations from there. Keep in mind that this is not 100% accurate, because users can (with some browsers) change the value of HTTP_USER_AGENT or not show it at all. (There is no way to accurately detect a user's browser 100% of the time)
     
    yonghoshin, Jan 10, 2009 IP
  4. JosephineX

    JosephineX Peon

    Messages:
    49
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    
    $ua = strip_tags(strtolower($_SERVER['HTTP_USER_AGENT']));
    
    if(eregi('firefox', $ua) || eregi('opera', $ua))
    {
    //allow content
    }
    else
    {
    //reject
    }
    
    PHP:
    The code above only allows access to firefox and opera, all other user agents are rejected.
    Use it with care as you will also block Googlebot and other crawlers
     
    JosephineX, Jan 11, 2009 IP
  5. weedman420

    weedman420 Guest

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thanks works great
     
    weedman420, Jan 11, 2009 IP
  6. JosephineX

    JosephineX Peon

    Messages:
    49
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Your welcome :D
     
    JosephineX, Jan 12, 2009 IP
  7. weedman420

    weedman420 Guest

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    but is there any remote ftp script.
    it should display other server files on my site and can enter other server pass, user, port...
    (not good english)
     
    weedman420, Jan 13, 2009 IP