chanfuterboy Posted August 9, 2009 Share Posted August 9, 2009 hi, i need help with a php script. When if i'm login. if somehow i go back to login.php i dont wanna see the page because im already login. someone can help me. Here is the script to check if someone is online or not, if not it send you to login page. <?php session_start(); require_once("connect.php"); if(!isset($_SESSION["username"])) { header('Location: login.php'); exit; } ?> Link to comment https://forums.phpfreaks.com/topic/169482-solved-if-login-dont-show-login-page/ Share on other sites More sharing options...
smerny Posted August 9, 2009 Share Posted August 9, 2009 you can use the same principal to direct them away from it. login.php: <?php session_start(); if(isset($_SESSION["username"])) { header('Location: index.php'); exit; } ?> Link to comment https://forums.phpfreaks.com/topic/169482-solved-if-login-dont-show-login-page/#findComment-894198 Share on other sites More sharing options...
chanfuterboy Posted August 9, 2009 Author Share Posted August 9, 2009 thanks Link to comment https://forums.phpfreaks.com/topic/169482-solved-if-login-dont-show-login-page/#findComment-894202 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.