Blocking a single referring page

Discussion in 'Programming' started by fordP, Aug 15, 2006.

  1. #1
    How do I block a certain referring page? I'm using a random image script on one of my sites and the easiest way to keep the images from loading on a certain page would be to be able to block the referring page from accessing the php file that contains the rotaters script. Can anyone tell me how I could go about blocking a certain referring page from accessing the script? such as www.mysite.com/terms.php
     
    fordP, Aug 15, 2006 IP
  2. fordP

    fordP Peon

    Messages:
    548
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    0
    #2
    edited out
     
    fordP, Aug 15, 2006 IP
  3. fordP

    fordP Peon

    Messages:
    548
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hmm i still havent figured this one out :-(
     
    fordP, Aug 15, 2006 IP
  4. talentcoder

    talentcoder Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    in your php file:
    if ($_SERVER['HTTP_REFERER'] == "blocked_site") {
    echo "you are blocked";
    exit()
    }
     
    talentcoder, Aug 16, 2006 IP