HeroSteve
-
Posts
3 -
Joined
-
Last visited
Posts posted by HeroSteve
-
-
I cleared that mistake but still recieving the same error.
-
Hey guys,
i'm a beginner to php so im trying to use this login registration system as a firm and strong foundation from this source "http://www.ineedtuto...em-php-tutorial" and i've met an error that im trying to fix for login.functions.php file on line 6 for syntax error, unexpected 'else' (T_ELSE). The code is:
<?php function isLoggedIn() { if (isset($_SESSION['loginid'])){ t echo $_SESSION['username']; { { return true; // the user is loged in } else { return false; // not logged in } return false; } function checkLogin($u, $p) { global $seed; // if (!valid_username($u) || !valid_password($p) || !user_exists($u)) { return false; } $query = sprintf(" SELECT loginid FROM login WHERE username = '%s' AND password = '%s' AND disabled = 0 AND activated = 1 LIMIT 1;", mysql_real_escape_string($u), mysql_real_escape_string(sha1($p . $seed))); $result = mysql_query($query); if (mysql_num_rows($result) != 1) { return false; } else { $row = mysql_fetch_array($result); $_SESSION['loginid'] = $row['loginid']; $_SESSION['username'] = $u; return true; } return false; } ?>
I've done some minor edits on session_is_registered with $_SESSION due to php updates but still dont know how to overcome the error.
Can you please help me on this particular problem and some explainations on the problem would be wonderful.
Thanks
Unexpected 'else' (T_Else) On Line 11 With Login Member System
in PHP Coding Help
Posted
Thanks for the help much appreciated