Dear All
I am trying to make a bit of script that detects whether it (the script itself) is running in a frame under a parent window. The object is to have the URL of the parent window in a variable. The reason that I want to do this, is that I want my script test.php only to run when it is in a frame with my main page index.php as a parent.
I cannot use the predefined variable HTTP_REFERER because the script test.php also calls itself test.php with target=_self
Is this possible?
Kind regards,
Boudewijn Verhaar 🙁
If I understood you correctly, it's just a javascript question! Put this in the head section of the framed document:
<script language="javascript"> if(window.location == top.location) {window.location.href="index.php";} </script>
Dear Swon
Thanks for your reply I want to avoid using javascript, as people may have disabled javascript. In that case, surfing my web site will be impossible ...
Otherwise, indeed, this would be the answer