Thread: else statements
View Single Post
Old 07-15-2010, 03:47 PM   #2 (permalink)
tony
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

it seems that you closed the double quotation with a single one and no semi colon in both echo statements. f

when you write a string you either go "this is a string" or 'this another string'. They have their own advantages.

try this:

php Code:
<?php
//Start session
session_start();
//Check whether the session variable
//SESS_MEMBER_ID is present or not
if(!isset($_SESSION['SESS_MEMBER_ID']) || 
    (trim($_SESSION['SESS_MEMBER_ID'])=='')) {
    echo "<a href='http://www.sb0t.tentun.co.uk/Login/login-form.php'>Click here</a> to login to your account.<br><a href='http://www.sb0t.tentun.co.uk/Login/register-form.php'>Click here</a> to create an account.";
     
} else {
echo '<a href="http://www.sb0t.tentun.co.uk/Login/logout.php">Click here</a> to logout.' ;
}
?>
tony is offline  
Reply With Quote
The Following User Says Thank You to tony For This Useful Post:
Tim Dobson (07-16-2010)