dch27 Posted June 10, 2008 Share Posted June 10, 2008 I have a form on a page to login ( www.simpleteam.net ). If the login is successful, I want the index.php to reload, a session started, and the form to be replaced with "Welcome - 'userName' : Logout" Is it just if/else? I tried that and i can't get it to work. Can somebody give me an example. Thanks a bunch. I've been ripping my hair out. I find login scripts everywhere but none include login confirmation. Link to comment https://forums.phpfreaks.com/topic/109624-login-confirmation-help/ Share on other sites More sharing options...
Asheeown Posted June 10, 2008 Share Posted June 10, 2008 <?php if($_SESSION['LoggedIn'] == 1) { echo "Welcome ".$_SESSION['Username']." : <a href=\"logout.php\">Logout</a>"; } else { // Show the login form, this is if the user is not logged in } ?> Session vars used in this: $_SESSION['LoggedIn'] Values: 0 or 1 $_SESSION['Username'] Value: Populated with username at login Link to comment https://forums.phpfreaks.com/topic/109624-login-confirmation-help/#findComment-562321 Share on other sites More sharing options...
dch27 Posted June 10, 2008 Author Share Posted June 10, 2008 Thanks, I will try this now. Link to comment https://forums.phpfreaks.com/topic/109624-login-confirmation-help/#findComment-562337 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.