Styles2304 Posted August 13, 2007 Share Posted August 13, 2007 ok, I'm trying to make a session deal for user authentication . . . it constantly returns invalid user name and/or password. Just to check what it's returning I did this: <?php //Starting the session and user authentication session_start(); include "conn.inc.php"; if (isset($_POST['submit'])) { $query = "SELECT Username, Password FROM UserInfo " . "WHERE Username = '" . $_POST['username'] . "' " . "AND Password = (PASSWORD('" . $_POST['password'] . "'))"; $result = mysql_query($query,$link) or die(mysql_error()); ?> <?php echo $result; ?> It gives me: Parse error: syntax error, unexpected $end in /home/styles/public_html/login.php on line 16 which is the "?>" I know it's syntax but I don't know what I'm doing wrong. Quote Link to comment Share on other sites More sharing options...
Gho§t Posted August 13, 2007 Share Posted August 13, 2007 You forgot to close that "if" statement. Quote Link to comment Share on other sites More sharing options...
uwannadonkey Posted August 13, 2007 Share Posted August 13, 2007 if (isset($_POST['submit'])) { $query = "SELECT Username, Password FROM UserInfo " . "WHERE Username = '" . $_POST['username'] . "' " . "AND Password = (PASSWORD('" . $_POST['password'] . "'))"; $result = mysql_query($query,$link) or die(mysql_error()); } ?> for the record, when you forget a curly, it runs code till end of page, meaning error is on last line, even if it isnt Quote Link to comment Share on other sites More sharing options...
Styles2304 Posted August 13, 2007 Author Share Posted August 13, 2007 ahhh I see, learn something new every day! Thanks! Quote Link to comment 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.