Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post I Need Some Help With Html Links.

    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!

    ~MarzNinja

  • #2
    Regular Coder
    Join Date
    Jan 2006
    Posts
    568
    Thanks
    6
    Thanked 84 Times in 84 Posts
    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:

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

  • #3
    New to the CF scene
    Join Date
    Dec 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks so much!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •