Forum Moderators: open

Message Too Old, No Replies

Disallow Page Load if Not Within an Iframe

How to Disallow a Page Loading Not Within an Iframe

         

DZur

9:52 am on Apr 7, 2008 (gmt 0)

10+ Year Member



Hi there,
DOES ANYONE KNOW HOW TO SUPPRESS A PAGE LOAD IF NOT VIA IFRAME?
As an example I allow a page named:
THE_PAGE_TO_BE_MONITORED.asp to load ONLY IF Set WITHIN AN IFRAME.

OK to load:

<IFRAME SRC="http://www.mysite.com/THE_PAGE_TO_BE_MONITORED.asp"
Name="this page may load" ID=OK>
</iframe>

Disallow/Stop Loading/Send an Alert Message with Warning if
(same page)loaded this way:

<a href="http://www.mysite.com/THE_PAGE_TO_BE_MONITORED.asp">DO SOMETHING TO SUPPRESS THIS PAGE LOAD</a>

I am trying this in order to disallow a visitor coming to my website
bypassing the index.htm page.

Thank you very very much and please respond a.s.a.p

piatkow

12:31 pm on Apr 7, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You don't want me to use my browser the way I want?
Unless you are selling something totally unique and indispensible I will either not bother or buy it from your competitors.

ZenArcher

3:18 pm on Apr 7, 2008 (gmt 0)

10+ Year Member



Here's the classic javascript to break out of a frame. Should be easy to reverse the logic.

<head>
<script language="JavaScript" type="text/javascript">
<!--
function break_frame() {
if (top.location != location) {
top.location.href = document.location.href; }
}
-->
</script>
</head>

tedster

5:25 pm on Apr 7, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In our Javascript Library, there's a thread called handy, generic javascript coding [webmasterworld.com]. Message #:1475958 from me is an approach to "FORCE MANY PAGES INTO FRAMES with one simple script". It can easily be adapted to iframes as well - so if someone requests the iframe's url in an orphaned state, you can load it into its parent frame for them.

tedster

8:05 pm on Apr 7, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This identical question is also posted in our PHP forum. I think we've covered the html aspects here anyway - let's take all further discussion over to PHP.

[webmasterworld.com...]

That way, any other person can easily follow the complete discussion.