block someone from using my php files

Discussion in 'Site & Server Administration' started by sp360, May 2, 2008.

  1. #1
    Hi, i have a php file on site that gets direct links from hosting sites. I noticed a couple of sites are using my script in there embed codes to get direct links.
    What i want is to block those sites from using my php file.
    is there a way?
     
    sp360, May 2, 2008 IP
  2. webcosmo

    webcosmo Notable Member

    Messages:
    5,840
    Likes Received:
    153
    Best Answers:
    2
    Trophy Points:
    255
    #2
    You could simply use a javascript to check the originating referrer. If it matches those sites redirect to something else.
     
    webcosmo, May 2, 2008 IP
  3. TheSyndicate

    TheSyndicate Prominent Member

    Messages:
    5,410
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    365
    #3
    yes thats a good idea i had the same problem
     
    TheSyndicate, May 2, 2008 IP
  4. sp360

    sp360 Well-Known Member

    Messages:
    1,023
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    160
    #4
    i did find a htaccess way to block the sites. But is there a good to redirect the person to another page when that page is requested?
    Thanks, SP360
     
    sp360, May 2, 2008 IP
  5. joebert

    joebert Well-Known Member

    Messages:
    2,150
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    145
    #5
    Stick with the htaccess method(s), they aren't going to be able to work around those.
     
    joebert, May 3, 2008 IP