mroberts46 Posted June 22, 2012 Share Posted June 22, 2012 I'm trying to figure out why my server is not recognizing that there is a break in the PHP code listed here: <?php include 'core/init.php'; if (empty($_POST)=== false) { $username = $_POST['username']; $password = $_POST['password']; if (empty($username) === true || empty($password) === true) { $errors[] = 'You must enter username and password'; } else if (user_exists($username) === false) { $errors[] = 'Username not found'; } else if (user_active($username) === false) { $errors[] = 'You must activate your account before you may login'; } else { $login = login($username, $password); if ($login === false) { $errors[] = 'The username/password combination you have entered is incorrect'; } else { $_SESSION['user_id'] = $login; header('Location: index.php'); exit(); } } } else { $errors[] = 'No data received.'; } include 'includes/overall/header.php'; if (empty($errors) === false) ( ?> <div id="container"> <h1>We tried to log you in but ...</h1> <?php echo output_errors($errors); } ?> </div> <?php include 'includes/overall/footer.php'; ?> Instead of parsing the entire page, it stops at : include 'includes/overall/header.php'; if (empty($errors) === false) ( ?> and throws this error: Parse error: syntax error, unexpected ';' in /***/***/***/***/public_html/new_site/testing/login.php on line 29 Anyone has any ideas on how might I fix this issue? Quote Link to comment https://forums.phpfreaks.com/topic/264586-parse-error/ Share on other sites More sharing options...
Pikachu2000 Posted June 22, 2012 Share Posted June 22, 2012 You have an opening parenthesis where a curly brace should be in the conditional. Quote Link to comment https://forums.phpfreaks.com/topic/264586-parse-error/#findComment-1355998 Share on other sites More sharing options...
mroberts46 Posted June 22, 2012 Author Share Posted June 22, 2012 Thank you so much. I thought sure I had double checked everything. Quote Link to comment https://forums.phpfreaks.com/topic/264586-parse-error/#findComment-1356001 Share on other sites More sharing options...
mroberts46 Posted June 22, 2012 Author Share Posted June 22, 2012 What's wrong with this line of code? I'm not seeing the problem but I'm getting an error. return (mysql_result(mysql_query("SELECT COUNT (`id`) FROM `user` WHERE `username` = '$username'"), 0) == 1) ? true : false; Quote Link to comment https://forums.phpfreaks.com/topic/264586-parse-error/#findComment-1356008 Share on other sites More sharing options...
Drummin Posted June 22, 2012 Share Posted June 22, 2012 You sorted this out already in another thread, right? COUNT('id') Quote Link to comment https://forums.phpfreaks.com/topic/264586-parse-error/#findComment-1356054 Share on other sites More sharing options...
mroberts46 Posted June 22, 2012 Author Share Posted June 22, 2012 Yep Quote Link to comment https://forums.phpfreaks.com/topic/264586-parse-error/#findComment-1356055 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.