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. Link to comment https://forums.phpfreaks.com/topic/64745-solved-another-unexpected-end/ 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. Link to comment https://forums.phpfreaks.com/topic/64745-solved-another-unexpected-end/#findComment-322886 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 Link to comment https://forums.phpfreaks.com/topic/64745-solved-another-unexpected-end/#findComment-322900 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! Link to comment https://forums.phpfreaks.com/topic/64745-solved-another-unexpected-end/#findComment-322906 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.