I am working on a login system for my PHP site. So to keep things basic, there's a login.php page and a loginProcessor.php page. The processor page verifies the email and password entered, ect... In the case that a user-entered value is invalid, the processor adds an error message in the session and sends it back (via header function) to the login page where the session errors are set to echo.
I originally started developing the site on my servers at HostGator, where everything worked fine (including the header functions). However, after moving the site locally to MAMP, the header functions stopped working. After the login.php page, it simply moves to the processor page and displays a blank/white page. However, the processor is still doing the verifications and ect... just not redirecting to the appropriate pages.
Here is the first instance where I call the header function in the processor.
$email = $_POST['email'];
$email = trim($email);
if ($email == '' || $email == 'Your Email') {
$_SESSION['login-error'] = '<div id="error">We didn\'t recognize the email address you entered.<br>Please try again.</div>';
ob_start();
header('/login/');
ob_end_flush();
return;
}
Any ideas?
Thank you!