Department of Computing: CS-344: Web Engineering
Department of Computing: CS-344: Web Engineering
Department of Computing: CS-344: Web Engineering
Class: BESE-10AB
Introduction:
Students have learned the advanced concepts of PHP during lecture including CRUD operations
on a relational database management system, file handling, working with PHP super global
arrays such as $_SESSION, $_COOKIE etc. In this lab the students will get practical multipage
web development knowledge using the advanced PHP concepts.
Lab Objectives:
The objective of this lab is helping students to familiarize themselves with the usage of PHP to
create multipage dynamic websites by communicating with relational databases, working with
file upload/retrieval and display over a page, and using super global arrays such as $_SESSION
and $_COOKIE.
Tools:
Notepad, DreamWeaver, browser.
Helping Material:
Lecture slides.
W3Schools: https://www.w3schools.com/php/
PHP: www.php.net
Lab Task
Notes:
1. In the previous lab, you have already worked with the ‘classicmodels’ database. You
have to add a new column in the ‘employees’ table to store the path of the profile
picture of each employee. The name of the column should be ‘picPath’ and it should be
of type varchar (255).
2. Using phpMyAdmin, make sure that the ‘employees’ table is updated successfully and
you can see the new column.
Task 1
Extend the script you have created in the previous lab so that the employee’s picture is also
present in the table (in first column). To retrieve the picture, you have to find the path of the
picture from the ‘picPath’ column and then use this path in the ‘src’ attribute of the <img> tag.
100 Market
Street, Suite Diane
VP
Jeff Firrelli jfirrelli@classicmodelcars.com 300, San Murphy, Edit | Update
Marketing
Francisco, President
CA, USA
Task 2
Extend the create and update employee scripts so that user can upload his/her profile picture
when creating or updating an employee. Any new record or any change in the record (update)
must be saved in the database.
https://www.w3schools.com/php/php_file_upload.asp
https://www.w3schools.com/php/php_file_create.asp
https://www.w3schools.com/php/php_file_open.asp
https://www.w3schools.com/php/php_file.asp
Task 3
Use super global arrays $_SESSION and $_COOKIE appropriately e.g. to store user’s information
in the session or to write cookies to store any important thing which can be useful in future.
Solution
Task 1:
Task 1 screenshot:
Task 2:
Task 2 screenshot:
Task 3:
Task 3 screenshot:
Deliverables
Compile a single word document by filling in the solution part and submit this Word file on LMS.
You must include your name, ID, and class on first page. The lab grading policy is as follows: The
lab is graded between 0 to 10 marks. For some of the labs, students have to present their
solutions in a viva session. In case of any problems with submissions on LMS, you should
contact your lab engineer Ms. Ayesha Asif.