• Register
Win an IPAD!!! Checkout this page!
x

Redirect in PHP

+1 vote
i am new in php. i want to redirect to login page or some other page is some conditions get ture like session is invaid. so tell me how can i do that.

thanks in advance
asked Jul 7, 2012 by anonymous  
    

1 Answer

+1 vote
 
Best answer

if((!$session->logged_in) || (($session->num != $_GET[num]) && ($session->num != $_POST[num])))
{
header("Location:websiteaddresshere");
exit;
}

or use switch condition

answered Jul 7, 2012 by dinkey (164 points)   1 5
selected Jul 7, 2012 by kriru
...