-   Programming (
-   -   force iframe content to remain in iframe? (

frieza 09-16-2008 01: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 07:29 AM


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

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


<script type="text/javascript" language="javascript">
// show login form in top frame
if (top != self) {;

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) {

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

All times are GMT -5. The time now is 09:08 PM.