Go to the source code of this file.
Functions | |
get_post ($var1) | |
This function returns value of POST variable whose name is given as argument. | |
main () | |
This is where program execution starts. | |
show_login_page () | |
This function displays login page which prints value of global variable message, followed by form for entering username and password. | |
Variables | |
$message = '' | |
Will be used to pass message to show_login_page() to be displayed at top of login form. |
This page will display login form and if username and password 'match' it redirects to welcome page.
Definition in file index.php.
get_post | ( | $ | var1 | ) |
This function returns value of POST variable whose name is given as argument.
If variable is not set it returns empty string "" as variable value.
var1 | Name of variable whose value should be searched in POST array |
main | ( | ) |
This is where program execution starts.
It checks if user is already logged in or not. If user is already logged in this page redirects to welcome.php page. If user is not logged in then it checks whether form was submitted or is being displayed for first time. If form is being displayed for first time it simply calls show_login_page() to display form. If form was submitted it redirects to welcome page if username and password match after setting proper session values, otherwise it displays login form again with message 'Username and password do not match'.
Definition at line 88 of file index.php.
References $_SESSION, $message, get_post(), get_session(), redirect(), and show_login_page().
show_login_page | ( | ) |
$message = '' |
Will be used to pass message to show_login_page() to be displayed at top of login form.