session_start();
header("Cache-control: private");
if(isset($_POST['username'])){
if(isset($_POST['password'])){
$username=$_POST['username'];
$password=$_POST['password'];
if($username="test"){
if($password="test"){
session_register('username');
session_register('password');
session_register('access_granted');
$_SESSION['access_granted']="YES";
$_SESSION['username']=$username;
$_SESSION['password']=$username;
header("Location: http://www.myronline.com/phptests/sestest2.php");
exit;
}else{
$loginerror="Incorect Password";
}
}else{
$loginerror="Unknown Username";
}
}else{
$loginerror="Please Enter Login Information:";
}
}else{
$loginerror="Please Enter Login Information:";
}
?>
This Code gives me these warnings.
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\phptests\sestest.php:4) in C:\Program Files\Apache Group\Apache2\htdocs\phptests\sestest.php on line 5
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Program Files\Apache Group\Apache2\htdocs\phptests\sestest.php:4) in C:\Program Files\Apache Group\Apache2\htdocs\phptests\sestest.php on line 5
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\Apache Group\Apache2\htdocs\phptests\sestest.php:4) in C:\Program Files\Apache Group\Apache2\htdocs\phptests\sestest.php on line 6
Can anyone tell me what I'm doing wrong. I'd greatly appreciates any help.
Thanks,
Dan