Jump to content

Check for Parent Window


agravayne

Recommended Posts

Hello,

 

Is it possible in PHP to check wether a page has a parent? I have a site that uses iframes in certain parts. The site has a timeout so after a certain time if left when the user clicks in one of the iframes it times out and takes them to the homepage - but that appears within the iframe!

 

What I need it to do is detect that its in an Iframe and if so refresh the parent not the child.

 

This is the function that checks.

 

function CheckLogin()
{
    if(!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] != "LoggedIn")
	header("Location: http://www.url.com/"); 		
}

 

So could I adapt this?

 

Many thanks

Scott

Link to comment
https://forums.phpfreaks.com/topic/155837-check-for-parent-window/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.