• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 240
  • Last Modified:

PHP Force Loading page in an iFrame

Hi we have a  page with an iframe that uses as source PHP pages.

we need a way to force this php pages in case they are called from outside.   direct linking, typed in url or by search engine

to be forced to load the parent page and them into the iframe

any help would be really appreciated.
0
basura
Asked:
basura
1 Solution
 
neesterCommented:
This is acutallly a HTML question...
Still need an answer?
0
 
Bernard S.CTOCommented:
To solve that, I would probably work from the javascript redirection mechanism.
i.e., in most of my sites there are the lines
<script language="javascript">
if (top.frames.length!=0)
top.location=self.document.location;
</script>
which checks if the page is framed or not. If it is, it because someone is framing it... and I break the frame so that my page displays alone on the browser window.

You could probably work along the lines of
<script language="javascript">
if (some condition)
top.location='http://the.full.iframed.page';
</script>
where 'some condition' might be testing the title of the topmost page etc.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now