17-mysql_database/address_book.php File Reference

This file is used to provide message book to visitors through which they can leave a message. More...

Go to the source code of this file.

Functions

 address_book_page ()
 This function displays address book page.
 main ()
 This is where program execution starts.
 verify_post_data ()
 This is used to verify data posted by user so that it does not causes database overflow errors.

Variables

 $date_of_birth = trim(get_post('date_of_birth'))
 $gaming_nick = trim(get_post('gaming_nick'))
 $iiit_mail_id = trim(get_post('iiit_mail_id'))
 $message = ""
 It is used to store all the messages to be displayed to user in html format.
 $mobile_number = trim(get_post('mobile_number'))
 $name = trim(get_post('name'))
 $other_mail_id = trim(get_post('other_mail_id'))
 $pc_name = trim(get_post('pc_name'))
 $peer_web_nick = trim(get_post('peer_web_nick'))
 $random_code = trim(get_post('random_code'))
 Used to store random code submitted by user through form.
 $remote_address = ""
 It is used to store remote address of client who has opened page.
 $roll_number = trim(get_post('roll_number'))
 $room_number = trim(get_post('room_number'))
 $verification_code = get_session('verification_code')
 It is used to store verification code during the session.


Detailed Description

This file is used to provide message book to visitors through which they can leave a message.

Author:
Saurabh Barjatiya
Version:
2.0

Definition in file address_book.php.


Function Documentation

address_book_page (  ) 

This function displays address book page.

Definition at line 17 of file address_book.php.

References $date_of_birth, $gaming_nick, $iiit_mail_id, $message, $mobile_number, $name, $other_mail_id, $pc_name, $peer_web_nick, $remote_address, $roll_number, $room_number, add(), connect_to_database(), and create_random_image().

Referenced by main().

main (  ) 

This is where program execution starts.

If page is opened for first time it displays user the message book. If message is being submitted it mails the message to proper user in case verification code is correct.

Definition at line 257 of file address_book.php.

References $date_of_birth, $gaming_nick, $iiit_mail_id, $message, $mobile_number, $name, $other_mail_id, $pc_name, $peer_web_nick, $random_code, $remote_address, $roll_number, $room_number, $verification_code, address_book_page(), connect_to_database(), get_remote_address(), redirect(), and verify_post_data().

verify_post_data (  ) 

This is used to verify data posted by user so that it does not causes database overflow errors.

This function is filled with magic values which ideally should be parameters. To keep number of parameters less the values are left as it is.

Returns:
true if error is found, false otherwise

Definition at line 172 of file address_book.php.

References $date_of_birth, $gaming_nick, $iiit_mail_id, $message, $mobile_number, $name, $other_mail_id, $pc_name, $peer_web_nick, $roll_number, and $room_number.

Referenced by main().


Variable Documentation

$date_of_birth = trim(get_post('date_of_birth'))

Definition at line 374 of file address_book.php.

Referenced by address_book_page(), main(), and verify_post_data().

$gaming_nick = trim(get_post('gaming_nick'))

Definition at line 375 of file address_book.php.

Referenced by address_book_page(), main(), and verify_post_data().

$iiit_mail_id = trim(get_post('iiit_mail_id'))

Definition at line 371 of file address_book.php.

Referenced by address_book_page(), main(), and verify_post_data().

$message = ""

It is used to store all the messages to be displayed to user in html format.

It helps is combining all messages from all functions before displaying output to user.

Definition at line 364 of file address_book.php.

$mobile_number = trim(get_post('mobile_number'))

Definition at line 368 of file address_book.php.

Referenced by address_book_page(), main(), and verify_post_data().

$name = trim(get_post('name'))

Definition at line 367 of file address_book.php.

Referenced by address_book_page(), main(), and verify_post_data().

$other_mail_id = trim(get_post('other_mail_id'))

Definition at line 372 of file address_book.php.

Referenced by address_book_page(), main(), and verify_post_data().

$pc_name = trim(get_post('pc_name'))

Definition at line 373 of file address_book.php.

Referenced by address_book_page(), main(), and verify_post_data().

$peer_web_nick = trim(get_post('peer_web_nick'))

Definition at line 376 of file address_book.php.

Referenced by address_book_page(), main(), and verify_post_data().

$random_code = trim(get_post('random_code'))

Used to store random code submitted by user through form.

It is later compared with session variable 'verification_code' to avoid automated submissions.

Definition at line 344 of file address_book.php.

Referenced by main().

$remote_address = ""

It is used to store remote address of client who has opened page.

It is used to avoid duplicate entries from same client and helps in making sure that proxy is bypassed before visiting the site.

Definition at line 357 of file address_book.php.

Referenced by address_book_page(), get_remote_address(), and main().

$roll_number = trim(get_post('roll_number'))

Definition at line 370 of file address_book.php.

Referenced by address_book_page(), main(), and verify_post_data().

$room_number = trim(get_post('room_number'))

Definition at line 369 of file address_book.php.

Referenced by address_book_page(), main(), and verify_post_data().

$verification_code = get_session('verification_code')

It is used to store verification code during the session.

It helps is avoiding automated submissions.

Definition at line 350 of file address_book.php.

Referenced by main().


Generated on Fri Nov 4 14:16:55 2011 for PHP example documentation by  doxygen 1.4.7