Jump to content

find out if they use frames


jasonc

Recommended Posts

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

Link to comment
Share on other sites

Your looking at javascript to break out of iframe

 

<script language="Javascript">
<!--
if (top.location!= self.location) {
top.location = self.location.href
}
//-->
</script>

 

as using $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'] will show the same if in iframe or accessing the actual page.

 

the javascript way also means that if they do try and scam* you then theres actually doing them selves over.

 

Regards

Liam

Link to comment
Share on other sites

thanks for the code you gave.

 

not sure how it will help as this only gives my the sites url and the file the script was run in.

 

unless i somehow check the php_self to see if it contains    <frame>    ?

 

 

 

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.

Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.