LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   force iframe content to remain in iframe? (http://www.linuxquestions.org/questions/programming-9/force-iframe-content-to-remain-in-iframe-670310/)

frieza 09-16-2008 12:52 PM

force iframe content to remain in iframe?
 
i have a web script (phpmyadmin) embeded in an iframe on a page, however whenever phpmyadmin refreshes to the login page it takes over the whole page and doesnt return to the iframe, how do i fix it so that it is always forced into the iframe instead?

Guttorm 09-17-2008 06:29 AM

Hi

I think you need to modify phpmyadmin. It's intentionally coded like this.

Look in the file "libraries/auth/cookie.auth.lib.php"

Code:

<script type="text/javascript" language="javascript">
//<![CDATA[
// show login form in top frame
if (top != self) {
    window.top.location.href=location;
}
//]]>
</script>

Probably it's because it uses frames itself, and without this, the login form would come in the left/right frames of phpmyadmin.

If your iframe has a name, I think something like this would work:

if (top.frames.iframename != self) {
top.frames.iframename.location.href=location;
}

Never tested it, so I don't know if it works though.


All times are GMT -5. The time now is 07:35 PM.