How do i ensure page is in frame
Posted: Sat Mar 13, 2004 3:10 pm
Hi gurus..etal
this is the javascript code i use to ensure that my page is in the correct frame
i wanna do this in php
without using header function
any idea's?
ta
this is the javascript code i use to ensure that my page is in the correct frame
Code: Select all
<script type="text/javascript">
//get a string so we can use it's search method
var str = new String(top.location);
//look for str in str
//if top location == this framed page
if(str.search('<?=$PHP_SELF?>') > -1) {
//this is not within a frame so redirect this window to the top frame
top.location="http://www.mydomain.com/myfolder/mypage.php";
}
</script>without using header function
any idea's?
ta