Page 1 of 1

redirection problem

Posted: Wed Mar 04, 2009 5:21 am
by pradeepa
Hi friends,

when the session is out iam redirecting my pages to login page.
using this code

if(!isset($_SESSION['userid']))
{
header("Location:login.php");
}

But my problem is iam using iframes
so login form is coming in iframe.
But i want the total page should redirect to login page

can anyone please help me.....

Re: redirection problem

Posted: Wed Mar 04, 2009 6:41 am
by papa
I'd use javascript for that:

You get some answers on Google, search for:
javascript location.replace target

Re: redirection problem

Posted: Wed Mar 11, 2009 12:01 am
by pradeepa
where i have to call javascript function in onload event?

Re: redirection problem

Posted: Wed Mar 11, 2009 12:46 am
by pradeepa
function refreshJsLogin(sessionid)
{
if(sessionid == "")
parent.location.href="index.php";
}

i called this function in body onload event it is working fine