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:
PHP is a widely used server side scripting language for web development. During lectures,
students have learned advanced concepts of PHP such as form handling, working with database
to retrieve, update, and delete records, and working with stored procedures and functions.
Students will practically get in-depth practical knowledge of the advanced PHP concepts in this
lab.
Lab Objectives:
The objective of this lab is helping students to familiarize themselves with the usage of PHP to
control dynamic and server side behavior of a web site by means of communication with
relational databases. Students will develop a small PHP application through which they will
interact with a database and will perform basic CRUD operations.
Tools:
Notepad, DreamWeaver, browser.
Helping Material:
Lecture slides.
W3Schools: https://www.w3schools.com/php/
PHP: www.php.net
Lab Task
Notes:
Task 1
Write a PHP script to display the information of the employees in tabular form. The employees
data can be retrieved from the ‘employees’ table. For each employee you have to display the
data as shown in the below figure.
1. You have to use a join to retrieve data of the reportsTo employee and the office
address. Both of these are given in the employees table as foreign keys.
2. The office address should display following: addressline1, addressline2, city, state, and
country.
3. ReportTo should display: employee first and last name, employee job title
Task 2
Using PHP, perform the CRUD operations on the employee table. This includes: create
employee, update employee, and delete employee. You should design forms where a user can
add/edit employee data and the data must be saved in the database upon submission.
Note: Upload complete solutions (css, html, js, php) for each task in in a single zip file along
with adding jQuery and screenshots of your solutions in this word file.
Solution
Task 1:
Task 1 screenshot:
Task 2:
Task 2 screenshot: