0% found this document useful (0 votes)
49 views

WE Lab 12

This document provides instructions for a lab assignment on PHP basics for the CS-344: Web Engineering class. The lab contains 3 tasks - the first asks students to write a PHP script to calculate statistics from temperature data, the second to create a table using for loops, and the third to generate a chess board using nested for loops. Students are provided with skeleton files and must submit single zip file with solutions and screenshots in a Word document.

Uploaded by

Bright Info
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

WE Lab 12

This document provides instructions for a lab assignment on PHP basics for the CS-344: Web Engineering class. The lab contains 3 tasks - the first asks students to write a PHP script to calculate statistics from temperature data, the second to create a table using for loops, and the third to generate a chess board using nested for loops. Students are provided with skeleton files and must submit single zip file with solutions and screenshots in a Word document.

Uploaded by

Bright Info
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Department of Computing

CS-344: Web Engineering

Class: BESE-9AB

Lab 12: PHP Basics

Date: 31 December, 2020

Instructor: Dr. Qaiser Riaz

CS-344: Web Engineering Page 1


Lab 12: PHP Basics

Introduction:
PHP is a widely used server side scripting language for web development. During lectures,
students have learned the syntax and basic concepts of PHP. Students have also learned basic
PHP concepts of functions, control structures, conditional statements, arrays etc. Students will
practically get in-depth practical knowledge of the basic 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. Students will develop small PHP
applications according to the given scenarios. The knowledge students have gained in the
lectures will help them to understand syntax of PHP.

Tools:
Notepad, DreamWeaver, browser.

Helping Material:
Lecture slides.

W3Schools: https://www.w3schools.com/php/

PHP: www.php.net

Lab Task

Task 1
Note: In the supporting material compressed file (see ‘lab-11-supporting-material.zip’), a
skeleton file is given which includes basic skeleton (‘task-1-skeleton.php’) for this task.

Write a PHP script to calculate and display average temperature, seven lowest and highest
temperatures as shown in figure below. The temperatures array is already created and
initialized in the skeleton script. (hint: php sort() function can be used to sort an array)

CS-344: Web Engineering Page 2


Task 2
Note: In the supporting material compressed file (see ‘lab-11-supporting-material.zip’), a
skeleton file is given which includes basic skeleton (‘task-2-skeleton.php’) for this task.

Write a PHP script that creates the following table using for loops

Task 3
Note: In the supporting material compressed file (see ‘lab-11-supporting-material.zip’), a
skeleton file is given which includes basic skeleton (‘task-3-skeleton.php’) for this task.

Write a PHP script using nested for loop that creates a chess board as shown below. (Hint: the
chess board is an 8x8 table. Use ‘bgcolor’ property of each cell to make it black or white).

CS-344: Web Engineering Page 3


Note: Upload complete solutions (css, html, js) 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:

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 Mr. Aftab Hussain by email at [email protected].

CS-344: Web Engineering Page 4

You might also like