I'm trying to display a "log in" / "log out" link. I want to display the log in link if they are not logged in, etc. I'm having trouble getting this to work. Heres what I've been trying:
<?php if (isset($_SESSION['access_token']))
{ ?> <a href="logout.php">Log out</a><?php } ?>
<?php
else
{ ?> <a href="login.php">Log In</a> <?php } ?>
Basically, if the assess_token is set, it will show a link to log out. And if not, a log in link. I keep getting this as an error:
Parse error: syntax error, unexpected T_ELSE
And i've tried this variation:
<?php if (isset($_SESSION['access_token']))
{ echo "<a href="logout.php">Log out</a>" }
else
{ echo "<a href="login.p">Log In</a>" } ?>
which get me:
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'
what am i missing here?