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?
if you loaded a page with IFrames, how do you get rid of the
Moderator: General Moderators
-
PHPHelpNeeded
- Forum Commoner
- Posts: 83
- Joined: Mon Nov 17, 2014 8:03 pm
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: if you loaded a page with IFrames, how do you get rid of
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.
(#10850)
-
PHPHelpNeeded
- Forum Commoner
- Posts: 83
- Joined: Mon Nov 17, 2014 8:03 pm
Re: if you loaded a page with IFrames, how do you get rid of
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.
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.
-
PHPHelpNeeded
- Forum Commoner
- Posts: 83
- Joined: Mon Nov 17, 2014 8:03 pm
Re: if you loaded a page with IFrames, how do you get rid of
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?
[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
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.