thewird Posted March 7, 2006 Share Posted March 7, 2006 Is there anyway to detect if a page is inside an iframe in PHP? Or is there a script that can do this? THanks.thewird Quote Link to comment https://forums.phpfreaks.com/topic/4376-detecting-if-page-is-inside-an-iframe/ Share on other sites More sharing options...
AndyB Posted March 8, 2006 Share Posted March 8, 2006 No. php runs on the server. iframes run on the client. Javascript can do something for you - maybe. Google from javascript frame detection and/or frame busting. Quote Link to comment https://forums.phpfreaks.com/topic/4376-detecting-if-page-is-inside-an-iframe/#findComment-15231 Share on other sites More sharing options...
thewird Posted March 8, 2006 Author Share Posted March 8, 2006 What if I'm the one creating the iframe? Is there anything I can do to give some sort of signal?thewird Quote Link to comment https://forums.phpfreaks.com/topic/4376-detecting-if-page-is-inside-an-iframe/#findComment-15233 Share on other sites More sharing options...
AndyB Posted March 8, 2006 Share Posted March 8, 2006 [!--quoteo(post=352689:date=Mar 7 2006, 07:13 PM:name=thewird)--][div class=\'quotetop\']QUOTE(thewird @ Mar 7 2006, 07:13 PM) [snapback]352689[/snapback][/div][div class=\'quotemain\'][!--quotec--]What if I'm the one creating the iframe? Is there anything I can do to give some sort of signal?[/quote]Well, that's a different question entirely. If you created the iframe you already know that you've placed a page in it, don't you? 'Some sort of signal' - to do what? how? when? why? Add some code to it ....[code]<?phpecho "Hello world. This is in an iframe";$whereami = "framed";?>[/code]If you want to explain what you're trying to do, then maybe someone can come up with a solution for you. Otherwise, it's just a guess at what might work. Quote Link to comment https://forums.phpfreaks.com/topic/4376-detecting-if-page-is-inside-an-iframe/#findComment-15244 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.