Jump to content

Url redirect to login page


vinothini

Recommended Posts

Hi,

In my application  i added session,so if session expired it ll go to logout page..

if i copy the url of any page in the application,and paste in new browser since the value is not there page is half loaded without any data..

 

so what i want is if i copy and paste tha page url in new browser it should automatically take to login page...can u pl tell me how to do that???

 

i can chk with session value and redirect the page but is any other method is there to do that????

Link to comment
https://forums.phpfreaks.com/topic/152740-url-redirect-to-login-page/
Share on other sites

yes. thanks for ur reply

actually i have a banner page included in all my pages in application so i included this condition there...that time got an error saying header already sent because i had html text before this include page

 

so i added this

<?php

if(!session_value){

echo "<meta http-equiv='refresh' content='0;url=http://localhost/../login.php'>";

}

?>

 

now it worked...

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.