Topic awaiting preservation: allow page loading as iframe only (Page 1 of 1) |
|
---|---|
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
posted 12-20-2005 21:28
so, here is a hard one for you guys. code: <script> if (top.frames.length == 0) location.href="/site/index.php?page=webshop"; </script>
|
Bipolar (III) Inmate From: f(x) |
posted 12-20-2005 22:17
You could use PHP to track requests. So for example, you get a hit to the webshop, have PHP check to see how long ago the main page has been hit by the user IP (or session). If it hasn't been hit for a while (within 5-10 minutes I guess) or not hit at all, send a location header to the main. |
Maniac (V) Inmate From: under the bed |
posted 12-20-2005 22:18
You can find the uri of the page, in PHP, using $_SERVER['PHP_SELF']. You can do a redirect using the header() function with the location attribute. |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 12-20-2005 22:35
DL that will get you in a loop, PHP_SELF will be the url of the iframe page no matter if it's in your iframe or not. |
Bipolar (III) Inmate From: f(x) |
posted 12-20-2005 22:43 |
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
posted 12-20-2005 23:34
thank you all! quote:
|
Bipolar (III) Inmate From: f(x) |
posted 12-21-2005 00:22 |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 12-21-2005 00:39
Yes you can hide referrers however you're not going to get a perfect answer to this question. There's no way for the server to distinguish between a request from within a frame and from without. |
Maniac (V) Inmate From: under the bed |
posted 12-21-2005 00:39
Right - was thinking the frame would return the php_self info from the parent...haven't worked with frames in years |
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
posted 12-21-2005 15:00
thanks again guys. |
Maniac (V) Inmate From: under the bed |
posted 12-21-2005 15:57 |
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
posted 12-21-2005 18:00 |
Paranoid (IV) Mad Scientist From: Omicron Persei 8 |
posted 01-08-2006 19:17
edit: i had a stupid idea, please ignore. |