Page 1 of 1

How Static Headers frame can redirect on timeout

Posted: Fri Jul 16, 2004 12:48 am
by inpreet
Hello,

I am facing a problem. I have a php Page which have two frames header and body.
Now header frame remain static and only body frame is redirected on timeout of page. This leads to 2 header frames on page because body frame is redirected to login page n which again make header as well as body frame from start.
can anyone tell me plz that how can I refresh my page along with redirecting it to login page. as with this only I can stop 2 headers on a page.
Thanks for ur help in advance.

Posted: Fri Jul 16, 2004 1:05 am
by feyd
how are you refreshing right now? Javascript? If so:

Code: Select all

<script language="Javascript">top.location.href = 'whatever/url.php';</script>

Posted: Fri Jul 16, 2004 1:20 am
by inpreet
if(!isset($_SESSION["ssn_userid"]))
{
//Cannot access this page without login.
//Redirect to login page
header("Location: login.php");
}

Now on this login.php I have functions which makes new header as well as body so that leads to 2 headers.

Posted: Fri Jul 16, 2004 1:31 am
by feyd
header() output cannot be targetted to a specific frame, sadly. You'll need to initiate the redirect via client-side controls..

In the future, please use the

Code: Select all

and

Code: Select all

for posting code. Read:  url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url]