View Full Version : I Need Some Help With Html Links.

Dec 22nd, 2009, 08:03 PM
I am making a forum for my own purposes and I the problem I have is when the user is logged out it shows the Register button.

No here is the problem, it still shows the Register button when the user is logged in. When the user is logged in he/she can click the Register button and can register again when he/she is still logged in!

I just need the code for changing links when the user is logged out and in.

What I am saying:
Logged Out: On that spot I want it to say Register (and it does)
Logged In: On that same spot I want it to say Log Out (and when you click it you log out)

Thanks for your help guys!


Dec 22nd, 2009, 08:44 PM
You're better off putting this in the serverside development section for whichever language you're developing this in.

If it's PHP, then something like:

if(isset($_SESSION['user'])) echo "<a href='logout.php'>Log out</a>";
else echo "<a href='register.php'>Register</a>";

Dec 22nd, 2009, 09:11 PM
Thanks so much!