Week 003
PHP and HTML Forms
Objectives
• At the end of the module the student is expected to:
• Create PHP pages using
• html forms;
• select tags;
• text area;
• option / radio buttons;
• checkbox tags
• Understand the application of assigning values to variables and
appending text in PHP scripts.
HTML FORMS
HTML FORMS
Filename: 11html_forms.html Filename: 11html_forms.php
USING SELECT Tag
USING SELECT Tag
Filename: 12Select_tag.html Filename: 12Using_Select.php
USING TEXT AREA TAG
USING TEXT AREA TAG
13using_textarea.html 13using_textarea.php
USING OPTION / RADIO BUTTON TAG
USING OPTION / RADIO BUTTON TAG
14using_radiobuttons.html 14using_radiobuttons.php
USING CHECKBOX TAG
USING CHECKBOX TAG
15using_checkboxes.html 15using_checkboxes.php
ASSIGNING VALUES TO VARIABLES
ASSIGNING VALUES TO VARIABLES
16assigning_values.html 16assigning_values.php
APPENDING TEXT
APPENDING TEXT
17appending_text.html 17appending_text.php
MACHINE PROBLEM
• You have been hired by DU30 Real Estate to develop a web site for their
company. They want to make sure they like your work so they will break
the project up into parts and have you develop one part at a time.
• You need to develop a form to collect customer data for a guest book. For
this first phase, you do not need to save the data entered at all... just
display it on a Web page.
• Make sure your Web Application meets the following criteria:
• 1. Put the DU30 Real Estate logo at the top of the page.
MACHINE PROBLEM
• 2. The customer should be able to enter their first and last name in
separate fields
• 3. Let the customer make a choice on whether they would like to be
contacted with their phone number or email and let them enter that
information only.
• 4. DU30 Real Estate only serves the following cities: Manila, Cebu,
and Davao. They
• should only be able to choose among those cities for potential places
to live.
• 5. Allow the user to enter comments.
• 6. Prove a submit button to send this information to the server.
MACHINE PROBLEM
• After the customer clicks the submit button:
• 1. Collect the information entered by the user.
• 2. Redisplay the information entered by the user being sure to indicate
their phone number or email, depending on what they entered in the
form.
• 3. The top of the page should include the company logo and a Thank
You message. Also, let them know that a representative will contact
them soon.
• 4. Be sure to display their comments in the same format as they
entered them but don't let them make any further changes to the text.