Jump to content

Archived

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

thewird

Detecting if Page Is Inside an Iframe

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
What if I'm the one creating the iframe? Is there anything I can do to give some sort of signal?

thewird

Share this post


Link to post
Share on other sites
[!--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]<?php
echo "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.

Share this post


Link to post
Share on other sites

×

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.