Can anyone help me with this.
Everytime I try to confirm username in a session I get this error message:
"Warning: Undefined variable: username in C:\Apache2\htdocs\Chapter24\member.php on line 6"
The code in member.php is:
<?
// include function files for this application
require_once("bookmark_fns.php");
session_start();
if ($username && $passwd)
// they have just tried logging in
{
if (login($username, $passwd))
{
// if they are in the database register the user id
$valid_user = $username;
session_register("valid_user");
}
else
{
// unsuccessful login
do_html_header("Problem:");
echo "You could not be logged in.
You must be logged in to view this page.";
do_html_url("login.php", "Login");
do_html_footer();
exit;
}
}
do_html_header("Home");
check_valid_user();
// get the bookmarks this user has saved
if ($url_array = get_user_urls($valid_user));
display_user_urls($url_array);
// give menu of options
display_user_menu();
do_html_footer();
?>
Does anyone know why I get the error. Everything else is Ok and works as it should.
Yours sincerely,
Kj