Jump to content

peanut2222

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Everything posted by peanut2222

  1. Thanks so much for the help guys, I've added the ; and <?php session_start(); $_SESSION['userid']; ?> to the top of the page, so the code now looks like: <?php if(!isset($_SESSION['userid'])) { echo "<a href='../register.php'>My Account | </a>"; echo "<a href='../logout.php?Logout=true'>Logout</a>"; } else { echo "<a href='../login.php'>Log In | </a>"; echo "<a href='../register.php'>Sign Up</a>"; } ?> But for some reason the 'MyAccount, Logout' version of the code is always visible, whether a user is logged in or not. can anyone see a reason for this? I've been trawling the net and php books looking for answers but im coming up blank. Thanks again!!!
  2. Hi all, Im new to php and Im having trouble creating a login/logout link for my page that displays as: Log Out | My Account. when a member is signed in, And: Log In | Sign Up When no one is signed in. The code I've been working with so far is: <?php if(!isset($_SESSION['userid'])) { echo "<a href='../register.php'>My Account</a>" echo "<a href='$thisPage?logout=true'>Logout</a>" } else { echo "<a href='../login.php'>Log In</a>" echo "<a href='../register.php'>Sign Up</a>" } ?> But when I try to view it nothing displays on the page. I'd love some help with this, thankyou thankyou thankyou!!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.