You are on page 1of 4

LAB#5 WEB PROGRAMMING

CST8285 W2024
Lab#5 Web Programming

LAB OBJECTIVE
The objective of this lab is to understand of PHP, form handling, and the
integration of multiple web technologies.

Learning Resources

Lecture Slides and resources (week 10 - week 12).

Earning
To earn your mark for this lab, each student should finish the lab’s requirements,
submit your lab on the Brightspace and demonstrate the working code to the
instructor.

Description
In this lab, you will delve into PHP – a server-side scripting language. PHP allows
you to execute code on the server, keeping it hidden from clients. Clients only
receive HTML, CSS, and JavaScript outputs, which are customized by PHP on
the server side. To practice PHP interactions, we will simulate a database
backend in this lab.

Requirements
In this lab you will take the starter HMTL code, break it up into semantic sections
so that it can be included in the PHP created HTML.
• If we bring up the page without any php code, then it will give you the
basic page shown below.
• Modify index.html file so that it uses the post method and specify
process.php as the form action.
• Define two string arrays, one containing the genres action, adventure,
comedy, and drama, and the other containing the subject Animation,
Children and Youth, and People.

Page 1 of 3
Lab#5 Web Programming

• Write a function that is passed a string array and returns a string


containing each array element within an <option> element. Use this
function to output the genre and subject <select> lists.

You can select the genre by choosing an item from the drop-down menu (we are
simulating building these items from a database, there will be an genre array that
will list the different movies genre in the PHP.

• Create a new file”process.php” so that it displays all the values that were
entered into the form , as shown in figure 2. This will require using the
appropriate superglobal array.
• storing the form submissions in a text file for future reference name this file
“data.txt?

Other Important Requirements


• Demo and justify your work and answer your lab professor’s questions.
• The work will be graded zero if you do not demo it on time, even if
uploaded.

Page 2 of 3
Lab#5 Web Programming

Submission
To submit the lab on the Brightspace, you must upload all the files including the
CSS file in a .zip file.

The zipped file must be named the following: <First Name>_<Last Name>.zip
Note that <First Name> and <Last Name> should be replaced with your first and
last name.

Grading Criteria:
Check the rubric for Lab5.

Page 3 of 3

You might also like