Login / Logout php link

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
peanut2222
Forum Newbie
Posts: 1
Joined: Mon Oct 26, 2009 10:32 pm

Login / Logout php link

Post 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!!
mischievous
Forum Commoner
Posts: 71
Joined: Sun Apr 19, 2009 8:59 pm

Re: Login / Logout php link

Post by mischievous »

just curious where are the ";" to close the lines out?
dhenick
Forum Newbie
Posts: 19
Joined: Tue Oct 20, 2009 10:46 am
Location: Yogyakarta, Indonesia
Contact:

Re: Login / Logout php link

Post by dhenick »

better than you show error message on your php.ini setting. so browser can show the output of php error message :mrgreen:
Post Reply