Page 1 of 1

Login / Logout php link

Posted: Mon Oct 26, 2009 10:37 pm
by peanut2222
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!!

Re: Login / Logout php link

Posted: Mon Oct 26, 2009 11:16 pm
by mischievous
just curious where are the ";" to close the lines out?

Re: Login / Logout php link

Posted: Tue Oct 27, 2009 12:37 am
by dhenick
better than you show error message on your php.ini setting. so browser can show the output of php error message :mrgreen: