Go to the source code of this file.
Functions | |
connect_to_database () | |
This function is used to connect to mysql server and use database. | |
create_random_image () | |
It is used to create random image. | |
get_post ($variable) | |
Following function is used to get post variable. | |
get_remote_address () | |
It is used to find proper i.p. | |
get_server ($variable) | |
Following function is used to get server variables. | |
get_session ($variable) | |
Following function is used to get session variable. | |
redirect ($page) | |
This function is used to redirect the user to given page. |
This file contains definitions of functions which can be used in many different pages.
Definition in file common_functions.php.
connect_to_database | ( | ) |
This function is used to connect to mysql server and use database.
Values for Username, password, database name, database server address are taken from constants DATABASE_USERNAME, DATABASE_PASSWORD, DATABASE_DBNAME and DATABASE_HOST respectively. if error occurs then this function displays proper error message and stops execution of script.
Definition at line 146 of file common_functions.php.
Referenced by address_book_page(), and main().
create_random_image | ( | ) |
It is used to create random image.
It stores the random number displayed in image in session variable 'verification_code'. It generates image named IMAGE_FILENAME. Web server must have write permissions on folder where image is to be created for this to work. Also php-gd package must be installed for the image manipulation functions to work. This function uses constants IMAGE_MINIMUM_NUMBER, IMAGE_MAXIMUM_NUMBER, IMAGE_CUTS, IMAGE_FONT_SIZE, IMAGE_SPACING, IMAGE_NUMBER_OF_CHARS, IMAGE_FILENAME, etc. for its operations.
Definition at line 98 of file common_functions.php.
References $_SESSION.
Referenced by address_book_page().
get_post | ( | $ | variable | ) |
Following function is used to get post variable.
If it does not exist then it returns empty string. But no warning or error is generated.
$variable | Name of the variable to be retrieved. It must be passed as string. |
Definition at line 79 of file common_functions.php.
get_remote_address | ( | ) |
It is used to find proper i.p.
address of client. It returns proper i.p. address even if the client is connected through proxy server.
Definition at line 42 of file common_functions.php.
References $remote_address, and get_server().
Referenced by main().
get_server | ( | $ | variable | ) |
Following function is used to get server variables.
If it does not exist then it returns empty string. But no warning or error is generated.
$variable | Name of the variable to be retrieved. It must be passed as string. |
Definition at line 29 of file common_functions.php.
get_session | ( | $ | variable | ) |
Following function is used to get session variable.
If it does not exist then it returns empty string. But no warning or error is generated.
$variable | Name of the variable to be retrieved. It must be passed as string. |
Definition at line 62 of file common_functions.php.
References $_SESSION.
redirect | ( | $ | page | ) |
This function is used to redirect the user to given page.
It redirects using META-REFRESH with time interval seconds.
page | Page relative to current page where user should be redirected. |
Definition at line 171 of file common_functions.php.
References redirect().