I am having trouble redirecting to a page after I check to see if a variable is empty or not.
Here is my code:
<?php
session_start();
if ($sesCustomerID=="") {
header("Location:http://localhost/login.php");
exit;
}
?>
I get errors: Warning: Undefined variable: sesCustomerID in c:\inetpub\wwwroot\default1.php on line 5
Warning: Cannot add header information - headers already sent by (output started at c:\inetpub\wwwroot\default1.php:5) in c:\inetpub\wwwroot\default1.php on line 6
$sesCustomerID is a session variable I created on the page before. If the variable exists, then it works fine, the rest of the page loads correctly. If it doesn't exist, I need the user to be redirected to a login page. Please Help!
Thanks,
Joe