Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Mar 2006
    Posts
    478
    Thanks
    3
    Thanked 0 Times in 0 Posts

    find out if they use frames

    i am starting a competition but have hit a snag

    any visitors (not members) click links and this increases the hits for that link on our site.
    but if say someone was to put this link to open in a hidden 'frame' on they site it would then seem like it was viewed by the person that view the other frame of that page.
    meaning that the hits would be false !

    what i would like to do is know if the page was viewed inside a frame?

    how can this be done please.


    thanks

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    There's no way to be absolutely sure unless you require some sort of user input. You could use Javascript to try to detect and break out of a frame, but that's no guarantee.

  • #3
    Regular Coder
    Join Date
    Mar 2006
    Posts
    478
    Thanks
    3
    Thanked 0 Times in 0 Posts
    yes true but disable javascript and they can still get around this.

    what about the server side info like the referral info, i know some sites do not send this but is there another way or another info tag i can use that is send to track if it was viewed in a frame, surely there must be a way for security reasons like the banks.

  • #4
    Regular Coder
    Join Date
    Mar 2006
    Posts
    478
    Thanks
    3
    Thanked 0 Times in 0 Posts
    i have a social bookmarking site and want to have a competition.

    the most clicks wins a prize.

    some links are shown on other site and we get the click-backs.

    www.site.com?siteid=123

    this is what the links look like on our site.

    i have had problems in the past with frames messing up voting scripts i wrote so need to get something as fully proof as possible.

    so when a visitor click the link on our site or via another social bookmarking site the counter for that link goes up!

    problem.....
    member adds a link, if this link gets the most hits they win. i have an ip checker i added to counter scripts so only unique hits count, or until the ip drops off the list of recent visitors.

    but..... if this member adds a hidden frame on another bookmarking site which views this page the hits goes up as it seems like the page was visited properly, and also the ip is different each time another person views his non-related page, which of course it was not. as i have a cheat.

    how do i solve this....

    javascript is not an option as it can be turned off.
    cookies too as this can be disabled or removed to allow further visits and increased hits.

    i am at a loss as to how i do this.

  • #5
    Regular Coder
    Join Date
    Mar 2006
    Posts
    478
    Thanks
    3
    Thanked 0 Times in 0 Posts
    ok i have now done the following to test if someone was using frames to view one of my pages.

    these are the scripts i have and the script that may be on what site they may be trying to cheat the site voting.

    say this file is on my site which will be used to find out if they are cheating....
    called votepage.php

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body>vote page<br>
    <?
    $info = $_SERVER['HTTP_HOST'].'<br>'.$_SERVER['PHP_SELF'];
    echo($info);
    ?>
    </body>
    </html>

    and these files are on the cheats site using a framed method to hide the frame that will cheat my site voting...
    say called

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <frameset rows="*,150" frameborder="NO" border="0" framespacing="0">
      <frame src="their own page-top-frame.php" name="mainFrame">
      <frame src="http://www.mysite.com/test/votepage.php?s=123" name="bottomFrame" scrolling="NO" noresize>
    </frameset>
    <noframes><body>
    
    </body></noframes>
    </html>
    i have not added a page for their top page, but the frames and my page on my site are the files needed to hopefully help someone in solving this problem i have.

    now if this was done it will mean that when anyone visited their site with these cheat files using the framed method it will increase the counters on my site who ever looked at 'their' site as the ip will be different for they visitors it will fool my site into thinking it is someone else which it is, but they are not actually looking at my site to make the vote.

    also for some reason the file votepage.php on my site that should detect if they are cheating does not show the url of the file that requested the file on my site. it is showing the url of my site and not theirs! which is what i need to help workout if the cheated.


    please help


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •