PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Dec 03, 2020 12:43 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Wed Nov 26, 2014 9:17 pm 
Offline
Forum Commoner

Joined: Mon Nov 17, 2014 9:03 pm
Posts: 83
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?


Top
 Profile  
 
PostPosted: Wed Nov 26, 2014 9:27 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13592
Location: New York, NY, US
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)


Top
 Profile  
 
PostPosted: Thu Nov 27, 2014 6:30 am 
Offline
Forum Commoner

Joined: Mon Nov 17, 2014 9:03 pm
Posts: 83
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.


Top
 Profile  
 
PostPosted: Thu Nov 27, 2014 6:42 am 
Offline
Forum Commoner

Joined: Mon Nov 17, 2014 9:03 pm
Posts: 83
Oh man, I have a bigger problem I am using this code:
Syntax: [ Download ] [ Hide ]
  1.     <?php 
  2.            function goToPage($url){ 
  3.                ob_start(); 
  4.                   header("Location: {$url}"); 
  5.                ob_end_flush(); 
  6.            } 
  7.  
  8.           function goToSettingsPage(){ 
  9.                 goToPage("http://[my ip]/Dashboard/Settings/settings.php"); 
  10.           } 
  11.  
  12.     ?> 
  13.    <div id="IdName" class="style_class"> 
  14.           <button id="settings_page" onclick="<?=goToSettings()?>" >Settings</button> 
  15.     </div> 


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?


Top
 Profile  
 
PostPosted: Thu Nov 27, 2014 7:45 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6425
Location: Montreal, Canada
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.

_________________


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group