Solved

PHP header(Location: somes_cript.php; target: frame_name) does not work

Posted on 2013-12-30
7
4,144 Views
Last Modified: 2013-12-30
I have a frameset page of the following code in a page called index.php:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
</HEAD>
<FRAMESET cols="10%, 90%">
  <FRAMESET rows="10%, "90%">
      <FRAME name="status" id="status" src="status.php" scrolling="no" noresize="noresize" frameborder="0" target="status" >
      <FRAME  name="menu" id="menu" src="menu.php"  scrolling="no" noresize="noresize" frameborder="0" target="menu" >
  </FRAMESET>
  <FRAMESET rows="20%, "80%">
      <FRAME name="header" id="header" src="header.php"  scrolling="no" noresize="noresize" frameborder="0" target="header">
      <FRAME  name="main" id="main" src="login.php"  scrolling="yes" noresize="noresize" frameborder="0" traget="main">
  </FRAMESET>
  <NOFRAMES>
      Sorry, your browser does not handle frames!
  </NOFRAMES>
</FRAMESET>
</HTML>

Open in new window



I want via an php script on the server running in the frame of target=main to let the rest of the framea to reload, I have read that this can be done using the header command, but I tried the following format but none is working:
 <?php
   session_start();
   header('Window-target: header');
   header('Location: header.php');
   header('Window-target: status');
   header('Location: status.php');
?>

Open in new window



And :

 <?php
   session_start();
   header('Location: header.php; Window-target: header');
   header('Location: status.php; Window-target: status');
?>

Open in new window


And I tried as well (Where here I used the location name is the php script where the frames are defined):
<?php
   session_start();
   header('Location: index.php; target: header');
   header('Location: index.php; target: status');
?>

Open in new window




But I am always getting these errors:
The requested URL /status.php; target: status was not found on this server.
The requested URL /index.php; target: status was not found on this server.
Can someone guide me how to force the other frames to reload?
0
Comment
Question by:Ashraf Hassanein
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 5

Assisted Solution

by:DamjanDemsar
DamjanDemsar earned 150 total points
ID: 39745817
Hmm, you cannot work outside the frame using PHP.

You can using javascript something like:

<script type="text/javascript">
parent.location.reload();
</script>

Open in new window

0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 39745845
Can you please step away from the technical details here and just tell us in plain language what you want to do?  Or show us a link to a site design that you want to emulate.  There are probably well-understood design patterns and if we can see the bigger picture we might be able to help you find a good design.
0
 

Author Comment

by:Ashraf Hassanein
ID: 39746334
Hi John,
     My website first page is a frame based where it has 4 frames
     1-Frame header where it have only the logo (At the begining when the user did not login yet).
     2- Frame Status where it is blank (At the begining when the user did not login yet).
     3- Frame menu where it is blank  (At the begining when the user did not login yet).
     4- Frame main where it has the login page

      When you login:
      1-The header frame has to be reloaded to show a toolbar.
      2- The status frame has to be reloaded to show the username, client IP, and his privileges
      3- The menu frame has to show the menu, and depending on the subscriber priviliges he will have different menu.
      4- The main frame will show the site content itself.


     For the moment I have have just created the php pages forthe header frame to show the toolbar and the status, once they are reloaded, and I am stuck here.
     My web site is:  https://www.hassans.nl
                              username/password: Guest123/Guest123
    Can you help me in that please?
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 110

Assisted Solution

by:Ray Paseur
Ray Paseur earned 150 total points
ID: 39746368
I can give a general idea about how one might design such an application.  First, you should read this article carefully.  It will show you how to do client authentication, including how to recognize that a client is "logged in" to your site.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_2391-PHP-login-logout-and-easy-access-control.html

PHP is used to access the request and data model, then generate the HTML, JavaScript and CSS that gets sent to the server.  As such, one PHP script can generate all of the parts of your web page, using PHP control structures to generate different components of the page for different clients, depending on whether they've "logged in" or not.  The single-script design will be simpler than trying to coordinate the work of four different scripts and will get you out of the problem of "Sorry, your browser does not handle frames!"
0
 
LVL 34

Accepted Solution

by:
Slick812 earned 200 total points
ID: 39746744
greetings Ashraf Hassanein, , Your use of the html <FRAMESET> is INCORRECT ! ! as you have TWO <FRAMESET> tags in your index.php html , , and ONLY ONE  <FRAMESET> tag is allowed in a single page html. You will need to REMOVE one of the framesets! ! I went to -
https://www.hassans.nl 
and in firefox, I could NOT SEE the frame with login.php,  There was NO user or password text inputs shown! ! so I could not try to log in. You have a BIG ERROR in your page with two  <FRAMESET> !

ALSO the <FRAMESET> tag is so out of date, and should not be used any more, in this era of html CSS style placement and design, the  <FRAMESET> is NOT NEEDED any longer! It is not recognized or supported as valid in the new HTML5 ! !
0
 

Author Comment

by:Ashraf Hassanein
ID: 39746808
Hi Slick thanks for your support, I am converting it now to div, thanks for your support, thanks for  DamjanDemsar and John for their help.
0
 

Author Closing Comment

by:Ashraf Hassanein
ID: 39746809
Very supportive and helpfule remarks
0

Featured Post

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question