Page 1 of 1
if you loaded a page with IFrames, how do you get rid of the
Posted: Wed Nov 26, 2014 8:17 pm
by PHPHelpNeeded
Hi,
I made a page that has serveral iframes loading separate web pages on in area of the frame on the screen.
One of those frame areas is a menus section. When I click on lets say the Settings button and I try to load the page, the new page still loads on the current frame.
Is there a way to get rid of the page that was loaded with iframes and load a webpage by itself on the browser?
Re: if you loaded a page with IFrames, how do you get rid of
Posted: Wed Nov 26, 2014 8:27 pm
by Christopher
You need to specify <a ... target="_top"> to have the new page load in the topmost document. You can name the frames and use target="" to specify a individual frame.
Re: if you loaded a page with IFrames, how do you get rid of
Posted: Thu Nov 27, 2014 5:30 am
by PHPHelpNeeded
Ah never mind, I will not use the IFRAME type of page because as I tried now, I will not be able to get rid of them.
I will just use <DIV> and then write all the code right on that same page, it will be huge, but no matter.
Thanks anyways.
Re: if you loaded a page with IFrames, how do you get rid of
Posted: Thu Nov 27, 2014 5:42 am
by PHPHelpNeeded
Oh man, I have a bigger problem I am using this code:
[syntax]
<?php
function goToPage($url){
ob_start();
header("Location: {$url}");
ob_end_flush();
}
function goToSettingsPage(){
goToPage("http://[my ip]/Dashboard/Settings/settings.php");
}
?>
<div id="IdName" class="style_class">
<button id="settings_page" onclick="<?=goToSettings()?>" >Settings</button>
</div>
[/syntax]
Note: this is only the part of the code that's is giving me problem...the rest is fine.
However, when I load the dashboard page where you see the code above, the onclick event on the button executes without it haven been clicked...any idea of how to fix this?
Re: if you loaded a page with IFrames, how do you get rid of
Posted: Thu Nov 27, 2014 6:45 am
by Celauran
PHP runs when the page first loads, and then it dies. It doesn't listen for events like key presses or button clicks. Your function is being executed because you're calling it when you display the button. The behaviour you're looking for (responding to mouse/keyboard events) requires JavaScript. Your sample code does beg the question of why a simple anchor wouldn't suffice.