agravayne Posted April 27, 2009 Share Posted April 27, 2009 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 More sharing options...
Mchl Posted April 27, 2009 Share Posted April 27, 2009 Nope. PHP runs on server. You can detect frames using JavaScript Link to comment https://forums.phpfreaks.com/topic/155837-check-for-parent-window/#findComment-820341 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.