if you loaded a page with IFrames, how do you get rid of the

HTML, CSS and anything else that deals with client side capabilities.

Moderator: General Moderators

Post Reply
PHPHelpNeeded
Forum Commoner
Posts: 83
Joined: Mon Nov 17, 2014 8:03 pm

if you loaded a page with IFrames, how do you get rid of the

Post 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?
User avatar
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

Post 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.
(#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

Post 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.
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

Post 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?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: if you loaded a page with IFrames, how do you get rid of

Post 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.
Post Reply