I keep getting the same two problems no matter what I do ...
Notice: Undefined index: name in /Users/KatKat/localhost/cms/_admin/admin.php on line 4
Warning: Cannot modify header information - headers already sent by (output started at /Users/KatKat/localhost/cms/_admin/admin.php:4) in /Users/KatKat/localhost/cms/_admin/admin.php on line 6
I have looked through tons of manuals and posts and I can't seem to find a solution that fixes the problems and still does what I need. The PHP on the page is ...
<?php
session_start();
if (!$_SESSION['name'])
{
header("Location: ../_scripts/login.php");
} else {
include ('admin_cont.php');
}
?>
The include is tiny too ...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
echo "Welcome, " . $_SESSION['name'] . "! <br /><a href='../_scripts/log_out.php'>Click here to Log out.</a>";
?>
</body>
</html>
That's all she wrote ...
Thanks