php and frames

Discussion in 'PHP' started by trichnosis, Nov 6, 2007.

  1. #1
    Hi;

    Is it possible to understand that my page is framed or not with using php?

    Thanks
     
    trichnosis, Nov 6, 2007 IP
  2. phper

    phper Active Member

    Messages:
    247
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #2
    With PHP, no. With JavaScript, yes.

    
    <script type="text/javascript">
    if (self != top) {
       alert("I'm in a frame!");
    }
    </script>
    
    HTML:
     
    phper, Nov 6, 2007 IP
  3. trichnosis

    trichnosis Prominent Member

    Messages:
    13,785
    Likes Received:
    333
    Best Answers:
    0
    Trophy Points:
    300
    #3
    thanks for the comments but i dont want to use java script. i need to find a way to prevent it without javascript:)
     
    trichnosis, Nov 6, 2007 IP
  4. phper

    phper Active Member

    Messages:
    247
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #4
    i'm afraid you'll be disappointed here. such info is not something that can be accessed / controlled from a server-side language like php.
     
    phper, Nov 6, 2007 IP
  5. garbageman

    garbageman Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If you know what site is framing your php file, you can check the referrer.
    
    if($_SERVER['HTTP_REFERRER'] == "http://thatdarnsitethatlinksinframes.com/")
    { die("I don't like frames!"); }
    
    PHP:
     
    garbageman, Nov 6, 2007 IP
  6. trichnosis

    trichnosis Prominent Member

    Messages:
    13,785
    Likes Received:
    333
    Best Answers:
    0
    Trophy Points:
    300
    #6
    mine is a bit stupid question:eek:

    as i know proxy sites are using frames to cache (or cheat) the pages. i have content based web site. i have been hijacked by proxy sites . i'm being hijacked by a new proxy site every day . i can not use java sciript because proxy sites are removing java script codes. i need somethink which proxy sites will not be able to remove (like php) from codes.

    i'm making a brain storm for this
     
    trichnosis, Nov 6, 2007 IP
  7. phper

    phper Active Member

    Messages:
    247
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #7
    Is checking for JavaScript an alternative? If JS is not enabled, assume it's not legitimate traffic / user.
     
    phper, Nov 6, 2007 IP
  8. trichnosis

    trichnosis Prominent Member

    Messages:
    13,785
    Likes Received:
    333
    Best Answers:
    0
    Trophy Points:
    300
    #8
    proxies are not playing the this game with the rules. proxy sites has become the another way of cheating.

    i need to protect myself against the proxy sites.

    i need somethink server side alternative like php for these cheaters.
     
    trichnosis, Nov 6, 2007 IP
  9. garbageman

    garbageman Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    You could encode your page in ioncube, the html obfuscator is free.
     
    garbageman, Nov 7, 2007 IP