Chinese Zodiac

[Banner Ad]





Web Forms

Handling Web Forms   Alphabetizing User Input   Zodiac Gallery    Zodiac Feedback Form   View Zodiac Feedback


Handling Web Forms

Web forms are created with HTML using a variety of input field types such as text fields, textareas, radio buttons, drop-down selection boxes and buttons. User input is then validated based on the type of data that is required. Input validation can be extensive depending on the application. The form can require certain fields be entered or that fields should contain only alpha characters or only numeric characters. Regular expressions can be used to verify input data that follows a pattern such as telephone numbers, email addresses and credit card numbers. Once the input is validated, the form may perform calculations for display or use server-side processing to access a database.

Alphabetizing User Input

This script asks the user to input the 12 Chinese Zodiac signs separated by commas. It will check to make sure that 12 items are entered but no other editing is done. An array is built from the input using the explode function. Then the array is sorted and displayed back to the user.
[Test the Script]   [View the Source Code]


Zodiac Gallery

This script displays a gallery of thumbnail images for the 12 Zodiac Signs. Each is hyperlink to a larger version of the image.
[Test the Script]   [View the Source Code]


Zodiac Feedback Form

This script allows the user to input feedback on the Chinese Zodiac Web site. It uses a form that asks the user to input Name and Comments. There is also a checkbox where they specify whether they want their comments to be publicly diplayed or not. The Name and Comments are stored in a database table along with the current date and time and a "Y" or "N" switch based on whether they checked the Publicly Display Message checkbox or not.
[Test the Script]   [View the Source Code]


View Zodiac Feedback

This script displays feedback comments from the Zodiac Feedback Database but only those comments where the user checked the Publicly Display Message checkbox.
[Test the Script]   [View the Source Code]


Home Page  Site Layout  Control Structures  String functions  Web Forms
Midterm Assessment  State Information  User Templates  Final Project