runnerjp Posted February 20, 2007 Share Posted February 20, 2007 i keep getitng this error Parse error: syntax error, unexpected T_ELSE in /home/runnerse/public_html/include/header.inc.php on line 5 why?? <? if($auth[displayname] == "")// if the variable is empty execute the fallowing { echo'Welcome Guest, please <a href="register.php">register'; { else { echo"you are logged in as".$auth[displayname]; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/39283-solved-error-with-ifauth/ Share on other sites More sharing options...
JasonLewis Posted February 20, 2007 Share Posted February 20, 2007 your going like this: {else{ it should be this: <? if($auth[displayname] == ""){ echo'Welcome Guest, please <a href="register.php">register'; }else{ echo"you are logged in as".$auth[displayname]; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/39283-solved-error-with-ifauth/#findComment-189348 Share on other sites More sharing options...
runnerjp Posted February 20, 2007 Author Share Posted February 20, 2007 oh yer thats so obvious lol sorry sometimes i find it hard to spot such easy mistakes thankyou Quote Link to comment https://forums.phpfreaks.com/topic/39283-solved-error-with-ifauth/#findComment-189349 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.