snowdog Posted January 21, 2012 Share Posted January 21, 2012 Keep going over this and can't find the stupid error. Need some fresh eyes for some help. Thanks <?php ob_start(); session_start(); include("include/db_connect.php"); // Define $username and $password $username = $_REQUEST['username']; $password = $_REQUEST['password']; // To protect MySQL injection $username = stripslashes($username); $password = stripslashes($password); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $sql="SELECT * FROM login WHERE username = '$username' AND password = '$password'"; $result=mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_array($result); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched, table row must be 1 row if($count!=0) { // Register session variables and redirect to file "dashboard.php" $_SESSION['id'] = $row['id']; $_SESSION['franchise_id'] = $row['franchise_id']; $_SESSION['dealer_id'] = $row['dealer_id]'; $_SESSION['first'] = $row['first']; $_SESSION['last'] = $row['last']; header("location:dashboard.php"); } else { header("location:not_logged_in.php"); } ob_end_flush(); ?> Quote Link to comment https://forums.phpfreaks.com/topic/255455-error-in-code-going-to-white-screen-and-not-redirecting/ Share on other sites More sharing options...
PFMaBiSmAd Posted January 21, 2012 Share Posted January 21, 2012 You have a fatal php parse error on line 41. You need to have php's error_reporting set to E_ALL and display_errors set to ON in your master php.ini so that php will report and display all the errors it detects. You will save a TON of time. I didn't mention what the error message is or what is causing it (it is actually fairly obvious to find when you know the general area in the code to start looking), because learning to find and fix errors in programming is as important a skill to have as being able to write code. Quote Link to comment https://forums.phpfreaks.com/topic/255455-error-in-code-going-to-white-screen-and-not-redirecting/#findComment-1309736 Share on other sites More sharing options...
snowdog Posted January 21, 2012 Author Share Posted January 21, 2012 Thanks, They told me at the server compaby that they had turned on errors and it was not. I have changed it and now the error stands out like a our thumb!! Single quote outside the bracket ! Duh James Quote Link to comment https://forums.phpfreaks.com/topic/255455-error-in-code-going-to-white-screen-and-not-redirecting/#findComment-1309737 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.