View Full Version : Breaking out of Iframe
Rohan72
02-15-2007, 10:46 PM
I'm running a login script on my homepage from within an Iframe.
I am pretty new to php and including some scripts on my homepage in Iframes, so i'm not breaking up the initial layout and I don't have to rewrite the entire site.
When I hit submit-button on the login inside the frame, it shows the page I want to go to inside the Iframe (thru an include(); ). Is there anyway of breaking out of the Iframe and reloading a completely new page?
ItsMeOnly
02-17-2007, 08:12 PM
this isn't PHP question, but yes, there is- in javascript it's
parent.document.location
Rohan72
02-18-2007, 02:42 AM
I know its possible with javascript, but the code for the login is written completely in php. So I'm wondering if there is a similar command in php that i could include in the script so that I can get the same result.
At this moment the script uses include() to go to the next page. All I want to know is, is there a command or script in php that would not refresh or reload the content inside the iframe the script is running in, but would load a totally different page.
boxxertrumps
02-18-2007, 02:47 AM
Not with php.
you need javascript for this.
thetestingsite
02-18-2007, 02:53 AM
All your php does (from your description) is output HTML. All javascript is, is an (for a lack of better words) extension of HTML to create interactivity for the user in the webpage. All you should have to do is add the javascript posted above in the "included" page of your login script.
Hope this helps.
motormichael12
02-18-2007, 06:39 PM
make javascript so it is using parent.location.href, so like set the fields in document.write or something. One problem though would be how it logs in; For the most help I would recommend you put the code on here so that we can edit it and show you what to do.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.