View Full Version : find out if they use frames

03-05-2008, 10:00 AM
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.


03-05-2008, 10:07 AM
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.

03-05-2008, 11:52 AM
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.

03-05-2008, 01:07 PM
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.


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!

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.

03-08-2008, 02:45 PM
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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<body>vote page<br>
$info = $_SERVER['HTTP_HOST'].'<br>'.$_SERVER['PHP_SELF'];

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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<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>


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