Go to the source code of this file.
Enumerations | |
enum | COOKIE_LIFE |
Used to define life of cookie in seconds with respect to now. More... | |
Functions | |
get_post ($var1) | |
This function returns value of POST variable whose name is given as argument. | |
main () | |
This function checks if page was submitted using 'Add' or 'Delete' or not. | |
show_cookies_page ($message) | |
This function displays a form with text areas and buttons for adding cookies. | |
Variables | |
$cookie_list = get_post('cookie_list') | |
Used to store array of cookies to be deleted. | |
$cookie_name = get_post('cookie_name') | |
Used to store name of new cookie to be added. | |
$cookie_value = get_post('cookie_value') | |
Used to store value of new cookie to be added. | |
$submit1 = get_post('submit1') | |
Used to store value of first submit button 'Add'. | |
$submit2 = get_post('submit2') | |
Used to store value of first submit button 'Subtract'. |
This is used as example for teaching PHP.
Definition in file index.php.
enum COOKIE_LIFE |
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 function checks if page was submitted using 'Add' or 'Delete' or not.
If one of those buttons was pressed then corresponding action is performed before displaying the page.
Definition at line 100 of file index.php.
References $cookie_list, $cookie_name, $cookie_value, $message, $submit1, $submit2, and show_cookies_page().
show_cookies_page | ( | $ | message | ) |
This function displays a form with text areas and buttons for adding cookies.
Below the form existing cookies are listed in select list and delete option for deleting existing cookies is provided.
message | Message to be displayed at top of page. |
Definition at line 55 of file index.php.
References $cookie_name, $cookie_value, $message, and $submit1.
Referenced by main().
$cookie_list = get_post('cookie_list') |
$cookie_name = get_post('cookie_name') |
Used to store name of new cookie to be added.
Definition at line 20 of file index.php.
Referenced by main(), and show_cookies_page().
$cookie_value = get_post('cookie_value') |
Used to store value of new cookie to be added.
Definition at line 23 of file index.php.
Referenced by main(), and show_cookies_page().
$submit1 = get_post('submit1') |
Used to store value of first submit button 'Add'.
Definition at line 14 of file index.php.
Referenced by main(), and show_cookies_page().
$submit2 = get_post('submit2') |