Blocking Access

Discussion in 'Programming' started by anir3598, Jan 15, 2009.

  1. #1
    Hi,

    Can anyone help me out?

    Need to know how to block all my website visitors who uses Opera as their web browser. Is there anyway to do this?

    Thank you. I will give +rep if anybody can really help me out.

    :)
     
    anir3598, Jan 15, 2009 IP
  2. infogle

    infogle Prominent Member

    Messages:
    2,732
    Likes Received:
    128
    Best Answers:
    1
    Trophy Points:
    300
    #2
    Okay... here you go with the solution.... just visit the following link to download a zip file and you will get some detailed information on how to block browsers....

    Download Link

    This is the detailed information...

    Hope it helps...
     
    infogle, Jan 15, 2009 IP
  3. anir3598

    anir3598 Banned

    Messages:
    258
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Downloaded the file.. but i am kinda confused how to use it to make it work. I almost know nothing about programming :-(
     
    anir3598, Jan 16, 2009 IP
  4. khan11

    khan11 Active Member

    Messages:
    615
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #4
    is your site coded in php? or you using normal html?
     
    khan11, Jan 16, 2009 IP
  5. anir3598

    anir3598 Banned

    Messages:
    258
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #5
    it is on php
     
    anir3598, Jan 16, 2009 IP
  6. bird.23

    bird.23 Peon

    Messages:
    13
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    <?php
    $browser = get_browser();
    if($browser->browser == "Opera")
    {
    print "you are blocked";
    }
    else
    {
    print "you are welcome";
    }
    ?>
     
    bird.23, Jan 16, 2009 IP
  7. anir3598

    anir3598 Banned

    Messages:
    258
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    cool.. but if you can tell me where do i put that code in?
     
    anir3598, Jan 16, 2009 IP
  8. rjd22

    rjd22 Peon

    Messages:
    63
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    you need to put it at top of your code I would use something like this:

    
    <?php
    $browser = get_browser();
    if($browser->browser == "Opera")
    {
    die("no access for opera");
    }
    ?>
    
    PHP:
     
    rjd22, Jan 16, 2009 IP
  9. khan11

    khan11 Active Member

    Messages:
    615
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #9
    or use include function, it will save your time for future.

    First create some file like, browser_check.php
    and put the code:
    
    <?php
    $browser = get_browser();
    if($browser->browser == "Opera")
    {
    die("no access for opera");
    }
    ?>
    
    PHP:
    and then include this code on top of all the pages of your site.
    make sure you provide the correct path for browser_check.php file.

    
    <?php
    include ("browser_check.php");
    ?>
    
    PHP:
     
    khan11, Jan 17, 2009 IP