how can I add a link with php only when a user is signed in?

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Guest
I'm using php for my use logins and my set up is..user types in information, it is saved in a mysql table, when they login it verifies the info. How can i make it so that i take away the login link with a logout link and add another link so the user can view their profile?
ok i understand the session variable thing now, but how do i actually "display the logout link and take away the login link? with what code would i put in the IF statement?
 
When your user logs in you should create a session variable such as $_SESSION['loggedin'] = true. This line would be placed after you write the user to the table successfully. If $_SESSION['loggedin'] is null then you know to display the login link else if $_SESSION['loggedin'] == true then you display the logout link. When the user clicks the logout link then you set the $_SESSION['loggedin'] to null.
 
Pssstt......I recomended visit .-*-.CAPITANCINEMA.-*-. com and enjoy full movies online AND READY TO DOWNLOAD IF U PREFER,new releases added everydays..just enter site in English And Join!!
 
Back
Top