This is probably a dumb question, I have errors on for debugging and noticed when I follow the "home" link after logging in to this member script that it generates this notice about undefined index. But it seems to display what I want other than that.
I believe it is just testing to see if the user is in the process of logging in or if they have actually been validated. If the variables exist then it will run the script to log them in...otherwise it verifies they are valid user and displays their info.
So is it safe to ignore these? They just won't be visible when I turn show errormessages off?
The notices are here:
Notice: Undefined index: username in /home/consult/public_html/development/Testing/26/member.php5 on line 8
Notice: Undefined index: passwd in /home/consult/public_html/development/Testing/26/member.php5 on line 9
The code that is generating it is here:
<?php
// include function files for this application
require_once('bookmark_fns.php5');
session_start();
//create short variable names
$username = $_POST['username'];
$passwd = $_POST['passwd'];
if ($username && $passwd)
// they have just tried logging in
{
try
{
login($username, $passwd);
// if they are in the database register the user id
$_SESSION['valid_user'] = $username;
}
catch(Exception $e)
{
// 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.php5', '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($_SESSION['valid_user']))
display_user_urls($url_array);
// give menu of options
display_user_menu();
do_html_footer();
?>