Solved

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

Posted on 2013-12-30
7
3,840 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
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 108

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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 108

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 33

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now