U W C PHP B: Nderstanding EB Oncepts and Asics

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Issue Date: Thursday, 20th May 2021

University of Technology and Applied Sciences – Nizwa Due date: Wednesday 26th May 2021
Information Technology Department
Course Code and Title: ITDB201, Web Application Development 1
Student ID: ………………. Name: ………………………………………………………… Section No. ( )
Semester 3 - 2020-2021 Marks Obtained: ..........
SELF-LEARNING ASSIGNMENT – STUDY & PRACTICAL-BASED)
Total Marks 10 (It will be converted into 5% of the total course mark)
UNDERSTANDING WEB CONCEPTS AND PHP BASICS
Important Instructions:
You can work on this assignment in a team of ONLY two students from your section.
Every team should answer 1 sub-question of the questions given below. The questions number you will
answer is based on the sum of the right-most digit of the of your IDs. If the 2 digits are the same then
add 1 to the sum.
Example: The ID of Ahmed is 26j1676 and the ID of his peer Marwan is 26s16269 then 6 + 9
= 15. They must answer the sub-question: Q5 of every question.
The details of the following questions are given in the attached sheets
Write a report using your own words and in which you:
Q1. Explain the given terms of Web Application Development? ...................................................................…….1 Mark
Q2. For each of the given PHP functions: ................................................................... 2 Marks
i. Explain the use of the function and its parameters
ii. Support your explanation with an example and write its output?
Q3. Rewrite the given PHP code after correcting the syntax and logical errors?..................................................... 1 Marks
Q4. Write the data that will go to Web Server when the end user clicks on the submit button in the following form? how this
data will be stored in the server? Your answer should be written as follows? .................................................. 2 Marks
Data will be stored in ……… as follows
Data name Data value

Q5. Write PHP code to answer the questions given after the two given arrays? You can write, test and run your code and
finally handwrite your answer in this report and you have to write the complete of your URL for your answer 4 Marks
The Academic Integrity and Plagiarism Policy:
You should be ready to prove the authenticity of your work. If any form of plagiarism/reproduction of answers/work
discovered, you will be awarded zero mark.
Late submission of the assignment: 1 mark out of the 10 will be deducted for each day after due date
You are expected to cover the outcomes: from number 1 to number 4 (for more details, refer to the delivery plan)
You are expected to practice the skills that are related to the following graduate attribute:
1. Effective Communication: active listening, critical reading, confident speaking and focused writing.
2. Scholastic rigor & practical competence: creative thinking, problem solving, analytical thinking, time management, dexterousness
and knowledgeability.
3. Teamwork: collaboration, tolerance and flexibility, planning, organization and time management.
4. Lifelong learning: research skills, critical thinking, inquisitiveness, goal setting, commitment and adaptability.
5. Autonomy and Accountability: work independently, confidence, responsibility, transparency, reliability and authenticity.
6. Innovation: imagination, aspiration, problem-solving, solution-integration, visionary and perseverance.
You have to submit the following things:
 Your learning action plan should be approved by your lecturer not later than Sunday 23rd May 21 (1 mark will be
deducted if you don't get it approved). Your learning action plan should be attached with your final report
 Your final report (maximum 2 pages)
 Include all references that you used (websites, books or specialized persons you might have met) and 1 mark will
be deducted if you don’t mention all references in your report.
 In case your lecturer requested you to authenticate your work, you must set an appointment with him for oral
questioning.
 Your report should be ended by the following handwritten statement and your signatures:
To my lecturer ………………………………….
I certify that the work was done by me as per the attached learning action plan
Student (1): Name: ………………………… Signature................................
Student (2): Name: ………………………… Signature................................
Submission Date: .................
CONTINUE TO NEXT PAGES TO SEE THE TASKS IN DETAIL
GOOD LUCK
Lecturers: Mr. Arun Kumar and Mr. Sami Khalil Mustafa

Page 1 of 11
Issue Date: Thursday, 20th May 2021
University of Technology and Applied Sciences – Nizwa Due date: Wednesday 26th May 2021
Information Technology Department
Course Code and Title: ITDB201, Web Application Development 1
Student ID: ………………. Name: ………………………………………………………… Section No. ( )
Semester 3 - 2020-2021 Marks Obtained: ..........

Q(1): Use your own words to explain each of the following terms of Web Application
Development and its relationship to the process of Web Application DEvelopment:

Terms of Web Application Development


1) Responsive Wed Design
2) Web Hosting with examples
3) Laravel and Symphony frameworks
4) Single Page Applications
5) JavaScript Object Notation data (JSON)
6) Web Applications Architectures
7) Node.js library
8) ECMAScript 2021
9) User Experience and its design
10) JavaScript Frameworks and libraries with examples

Q(2): For each of the following PHP Functions:


a) Use your own words to explain the use of the function and its parameters
b) Support your explanation with an example not from the internet.
c) Write down the output of the example you used.

PHP Functions
1) addslashes()
2) scandir()
3) fclose() and unlink()
4) count_chars()
5) str_replace()
6) strip_tags()
7) mkdir() and getcwd()
8) stripslashes()
9) fopen(),fwrite()
10) file()

Page 2 of 11
Issue Date: Thursday, 20th May 2021
University of Technology and Applied Sciences – Nizwa Due date: Wednesday 26th May 2021
Information Technology Department
Course Code and Title: ITDB201, Web Application Development 1
Student ID: ………………. Name: ………………………………………………………… Section No. ( )
Semester 3 - 2020-2021 Marks Obtained: ..........
Q3: Rewrite the following PHP after correcting the syntax or logical errors

PHP code snippet with errors


1. <?php
2. $name="Yahya Hamad"
1)
3. echo "Your Name<input type="text" name="name""
4. ?>
1. <?php
2. $name=Yahya Hamad;
2)
3. Color=#ffcc99;
4. ?>
1. <?php
2. $name="Yahya Hamad";
3) 3. echo "Your Name<input type='text' $name='$name'";
4. ?>
1. <?php
2. $name="Yahya Hamad";
4)
3. echo "Your Name<input type='text' $name='Yahya Hamad'";
4. ?>
1. <? php
2. $country = "Nizwa";
5) 3. echo "<h1> '$country' </h1>"
4. $a=$country . " is beautiful city"
5. ?>
1. <php
2. $country = "Nizwa";echo "<h1> {$country} </h1>";
6)
3. $a="$country " is beautiful city";
4. ?>
1. <?php
2. $names=[Ahmes, Salim, Ali]; --- array values
7)
3. $gsms=Sony,Samsung,Nokia; --- string value
4. ?>
1. $day1=array{"Sat","Sun","Mon"}; // or
2. $day2=array["Sat","Sun","Mon"]; // or
8) 3. $day3={"Sat","Sun","Mon"}; // or
4. $day4=['S'=>"Sat",'N'=>"Sun",'T'="Mon"];
5. ?>
1. <?php
2. $names = ['Hamad',Moosa';'Ahmed'];
9) 3. echo "Second Name is $names[1]";
4. echo $Names;
5. ?>
1. $country = "Nizwa";
2. <center>OMAN</center>
3. <?php
10)
4. v1='Salim';
5. echo $v1 . " is from " . $contry;
6. ?>

Page 3 of 11
Issue Date: Thursday, 20th May 2021
University of Technology and Applied Sciences – Nizwa Due date: Wednesday 26th May 2021
Information Technology Department
Course Code and Title: ITDB201, Web Application Development 1
Student ID: ………………. Name: ………………………………………………………… Section No. ( )
Semester 3 - 2020-2021 Marks Obtained: ..........
Q4: Write data that will go to the Web Server when the end user clicks on the submit button
in the following HTML Form?
HTML Form and its source code

1)

2)

3)

<form action="save.php" method="post">


Entering Exam Data Exam Date:Day<select
name="ed"><option value=05>5</option><option
value=31>31</option></select>Month <select
name="em"><option value=04>April</option>
<option value=05>May </option> </select>
Year<select name="ey"><option value=2018>
2018</option> </select>Course Title:<INPUT
4) type="text" name="ect"> Course Code:<INPUT
type="text" name="ec">Section Number:<INPUT
type="text" name="es">Set of Exam:<INPUT
type="radio" name="et" value=A>Set A
<INPUT type="radio" name="et" value=B>Set B
<INPUT type="radio" name="et" value=C>Set C
<INPUT type='submit' name='save' value="Save
Exam Data"></form>

Page 4 of 11
Issue Date: Thursday, 20th May 2021
University of Technology and Applied Sciences – Nizwa Due date: Wednesday 26th May 2021
Information Technology Department
Course Code and Title: ITDB201, Web Application Development 1
Student ID: ………………. Name: ………………………………………………………… Section No. ( )
Semester 3 - 2020-2021 Marks Obtained: ..........
HTML Form and its source code
<form action="proc.php" method="post">
Adding Order Data
Order Date: Day<select name="rd"><option value
=29>29</option><option value=31>31</option>
</select>Month<select name="rm"><option
value=05>May</option><option value=06>June
</option></select>Year<select name="ry">
<option value=2019>2019</option></select>
Order No.:<INPUT type="text" name="rn">
5) Supplier Name:<INPUT type="text" name="rs">
Order Type?<INPUT type="radio" name="rt"
value='O'>Online<INPUT type="radio" name="rt"
value='F'>OfflineType of Chips to Order
<input type=checkbox value=SR name="chpr[]">
Suhar<input type=checkbox value=OM
name="chpr[]">Oman<input type=checkbox
value=LS name="chpr[]">Lays<INPUT
type='submit' name='add' value="Save Order
Data"> </form>
<form action="proc.php" method="post">
Adding Order DataOrder Date: Day<select
name="od"><option value='x'>Day</option>
<option> value=31>31</option></select>Month
<select name="om"><option value=05>May
</option><option value=06>June</option>
</select>Year<select name="oy"><option value=
2019>2019</option></select>Order No.:<INPUT
type="text" name="on">Supplier Name:<INPUT
6) type="text" name="os">Order Type?<INPUT type=
"radio" name="ot" value='O'>Online<INPUT
type="radio" name="ot" value='F'>Offline Type
of Chips to Order <input type=checkbox
value=SR name="ochp[]">Suhar<input type=
checkbox value= OM name="ochp[]">Oman<input
type= checkbox value=LS name="ochp[]">
Lays<INPUT type= 'submit' name='add' value=
"Save Order Data"> </form>
<form action="proc" method="post">
Adding Book Data<br>Book Title:<INPUT
type="text" name="bt">Book Subject:<select
name="bs"><option value='k'>Click to
Select</option><option value=IT>IT</option>
<option value=BUS>Business </option><option
value=ENG>Engineering</option></select>Book
Content:<INPUT type="checkbox" name="bc[]"
value='CH'>Charts <INPUT type="checkbox"
7) name="bc[]" value='DR'>Diagrams<INPUT type=
"checkbox" name="bc[]" value='TB'>TablesBook
Price:<INPUT type="text" name="bp">Publishing
Date:<br>Day<select name="pd"><option value=
'x'>Day</option><option value=03>03</option>
</select>Month<select name="pm">…<option value
=y>Month</option><option
value=x>Month</option></select>Year<select
name="py"><option value='y'>Year</option>
</select> </form

Page 5 of 11
Issue Date: Thursday, 20th May 2021
University of Technology and Applied Sciences – Nizwa Due date: Wednesday 26th May 2021
Information Technology Department
Course Code and Title: ITDB201, Web Application Development 1
Student ID: ………………. Name: ………………………………………………………… Section No. ( )
Semester 3 - 2020-2021 Marks Obtained: ..........
HTML Form and its source code
<form action="save.php" method="post">
Adding GSM Data GSM Code:<INPUT type="text"
name="gc">GSM Model:<INPUT type="text"
name="gm"> Delivery Date:<br>Day<select
name="dd"><option value=09>9</option><option
value=31>31 </option></select>Month<select
name="dm"> <option value=03>March</option>
<option value=04>April</option></select>
Year<select name="dy"><option value=2016>
8) 2016</option> </select> Colors:?<INPUT
type="checkbox" name="gcr[]" value='1'>White
<INPUT type="checkbox" name="gcr[]"
value='2'>Black <INPUT type="checkbox"
name="gcr[]" value='3'> OtherMade In:<select
name="gmd"><option value= 'N'>Choose from the
list</option><option value=100>USA</option>
<option value=200> China</option></select>
<INPUT type='submit' name='add' value="Save
GSM Data"></form>
<form action="save.php" method="post">
Entering Family DataFather's Age:<INPUT
type="text" name="age">Wilayat Name:<INPUT
type="text" name="fwl">Fruits Family
Like:<INPUT type="checkbox" name="frt[]"
value='AP'>Apple<INPUT type="checkbox"
name="frt[]" value='OR'>Orange<INPUT
type="checkbox" name="frt[]" value='BN'>Banana
<INPUT type="checkbox" name="frt[]" value=
'OT'>OtherFather's Date of Birth:<br>Day
9) <select name="db"><option value='x'>Day
</option><option value=31>31</option>
</select>Month<select name="mb"><option
value='x'>Month</option><option value12=>Dec
</option></select>Year<select name="yb">
<option value='x'>Year</option></select>Does
Father has a Job?<select name="job"><option
value=''>Your Answer</option><option value=Y>
Yes</option><option value=N>No</option>
</select><INPUT type='submit' name='add'
value="Save Family Data"></form>
<form action="save.php" method="post">
Item Code:<INPUT type="text" name="tc">Item
Description:<INPUT type="text" name="td">
Price:<input type="text" name="tp">Purchase
Date:Day<select name="td"><option value='d'>
Day</option><option value=31>31</option>
</select>Month<select name="tm"><option value=
'm'>Month</option><option value=02>Feb
10) </option></select>Year<select
name="ty"><option value= 'y'>Month</option>
</select><br> User must select correct
date)<br>Supplier:<select name="ts"><option
value='m'>-- Select Supplier--</option><option
value=1>Supplier A</option><option value=2>
Supplier B</option><option value=3>Supplier
C</option></select><input type='submit'
name='add' value="Save Item Data"></form>

Page 6 of 11
Issue Date: Thursday, 20th May 2021
University of Technology and Applied Sciences – Nizwa Due date: Wednesday 26th May 2021
Information Technology Department
Course Code and Title: ITDB201, Web Application Development 1
Student ID: ………………. Name: ………………………………………………………… Section No. ( )
Semester 3 - 2020-2021 Marks Obtained: ..........
Q(5): Given the following PHP Arrays:
$iTypes=['L'=>'Laptop', 'P'=>'PC','R'=>'Printer'];
$item=['iId'=>'SN01','iDesc'=>'Sony v15','iPrice'=>380,'iType=>'L'];
Answer the following questions
a. What is the fourth element in the $item array?
b. Write PHP statement to send the following messages to Web Browser?
1)
1. The array $item has 4 elements
2. Use the 2 arrays to send the following data:
Item: Sony V15 === Price: 380 === Type: Laptop
3. Send the content of $item array in HTML table and highlight ONLY 'Sony
v15' in yellow background.
$catgry=['I'=>'Islamic', 'T'=>'IT','E'=>'Engineering'];
$magazine =['mTitle'=>'Islam History','mCatgry'=>'I', mPages'=>265];
Answer the following questions
a. What is the first element in the $catgry array?
b. Write PHP statement to send the following messages to Web Browser?
2)
1. The array $magazine has 3 elements
2. Use the 2 arrays to send the following data:
Title: Islamic History -- Category: Islamic -- Pages: 265
3. Send the content of $magazine array in HTML table and highlight ONLY
'Islamic History' in yellow background
$jobs = ['A'=>'Accountant','M'=>'Manager','C'=>'Clerk'];
$employee=['eID'=>'e61','eName'=>'Abdullah Saif',
'eSalary'=>630,'eJob'='M'];
Answer the following questions
a. What is the third element in the $employee array?
3) b. Write PHP statement to send the following messages to Web Browser?
1. The array $employee has 4 elements
2. Use the 2 arrays to send the following data:
Name: Abdullah Saif *** Salary: 620 === Job: Manager
3. Send the content of $employee array in HTML table and highlight ONLY
'Abdullah Saif' in pink background.

$subjects=['BUS'=>'Business Studies','IT'=>'Information Technology'];


$book=['bName'=>'Leadership','bSubj'=>'BUS','bLang'=>'English'];
Answer the following questions
a. What is the third element in the $subjects array?
b. Write PHP statement to send the following messages to Web Browser?
4)
1. The array $book has 3 elements
2. Use the 2 arrays to send the following data:
Name: Leadership -- Language: English -- Subject: Business
3. Send the content of $book array in HTML table and highlight ONLY
'English' in yellow background.

Page 7 of 11
Issue Date: Thursday, 20th May 2021
University of Technology and Applied Sciences – Nizwa Due date: Wednesday 26th May 2021
Information Technology Department
Course Code and Title: ITDB201, Web Application Development 1
Student ID: ………………. Name: ………………………………………………………… Section No. ( )
Semester 3 - 2020-2021 Marks Obtained: ..........
$mTypes=['V'=>'Volley ball','F'=>'Football','T'=>'Tennis'];
$match=['mName'=>'Teams X & Y','mType'='F','mDate'='2021-06-21'];
Answer the following questions
a. What is the second element in the $match array?
b. Write PHP statement to send the following messages to Web Browser?
5)
1. The array $match has 3 elements
2. Use the 2 arrays to send the following data:
Name: Teams X & Y ** Date: 2021-06-21 ** Type: Football
3. Send the content of $match array in HTML table and highlight ONLY
'2021-06-21' in pink background.
$eSubjects=['S'=>'Sceince','A'=>'Arts','C'=>'Culture'];
$editor=['edName'=>'Hamad Khalid','edSubj'=>'C','edSalary'=475];
Answer the following questions
a. What is the third element in the $editor array?
b. Write PHP statement to send the following messages to Web Browser?
6)
1. The array $editor has 3 elements
2. Use the 2 arrays to send the following data:
Name: Hamad Khalid *** Salary: 475 === Subject: Culture
3. Send the content of $editor array in HTML table and highlight ONLY
'Hamad Khalid in lightgreen background.
$cTypes=['I'=>'Individual','O'=>'Organization','E'=>'Employee'];
$customer=['cName'=>'Omar Al-Hinai','cType'=>'I','cBalance'=>230];
Answer the following questions
a. What is the second element in the $customer array?
b. Write PHP statement to send the following messages to Web Browser?
7)
1. The array $customer has 3 elements
2. Use the 2 arrays to send the following data:
Name: Omar Al-Hinai ** Balance: 230 ** Type: Individual
3. Send the content of $customer array in HTML table and highlight ONLY
Omar Al-Hinai in yellow background.

$examTypes=['T'=>'Theory','P'=>'Practical','M'='Mixed'];
$exam=['xSubj'=>'General Sciences','xDate'='2021-08-23','xType'=>'P'];
Answer the following questions
a. What is the third element in the $exam array?
b. Write PHP statement to send the following messages to Web Browser?
8)
1. The array $exam has 3 elements
2. Use the 2 arrays to send the following data:
Subject: General Sciences ** Date: 2021-08-23 ** Type: Practical
3. Send the content of $exam array in HTML table and highlight ONLY General
Sciences in yellow background.:

Page 8 of 11
Issue Date: Thursday, 20th May 2021
University of Technology and Applied Sciences – Nizwa Due date: Wednesday 26th May 2021
Information Technology Department
Course Code and Title: ITDB201, Web Application Development 1
Student ID: ………………. Name: ………………………………………………………… Section No. ( )
Semester 3 - 2020-2021 Marks Obtained: ..........
$tTypes=['S'=>'Samsung','T'=>'Toshiba','S'=>'Sony'];
$tv=['tDesc'=> 'Smart 200','tType'=>'S','tSize'=>'50inch','tId'='S1'];
Answer the following questions
a. What is the second element in the $tv array?
b. Write PHP statement to send the following messages to Web Browser?
9)
1. The array $tv has 4 elements
2. Use the 2 arrays to send the following data:
Description: Smart 200 == Size: 50inch == Type: Samsung
3. Send the content of $tv array in HTML table and highlight ONLY Smart 200
in pink background.
$supType=['L'=>'Local','E'=>'External'];
$supplier=['sId'=>'E1','sName'=>'Lulu Hypermarket','sPhone'=>'983832',
'sType'=>'L'];
Answer the following questions
a. What is the fourth element in the $supplier array?
b. Write PHP statement to send the following messages to Web Browser?
10) 1. The array $supplier has 4 elements
2. Use the 2 arrays to send the following data:
Name: Lulu Hypermarket ** Phone: 983832 ** Type: Local
3. Send the content of $supplier array in HTML table and highlight ONLY
Lulu Hypermarket in pink background.:

END OF THE SELF-LEARNING ASSIGNMENT


GOOD LUCK
Lecturers: Mr. Arun Kumar & Mr. Sami Khalil Mustafa

Page 9 of 11
Issue Date: Thursday, 20th May 2021
University of Technology and Applied Sciences – Nizwa Due date: Wednesday 26th May 2021
Information Technology Department
Course Code and Title: ITDB201, Web Application Development 1
Student ID: ………………. Name: ………………………………………………………… Section No. ( )
Semester 3 - 2020-2021 Marks Obtained: ..........

Report on The Concepts of Web Application Develolpment and PHP Basics


Prepared By: xxxxxx and yyyyyyyy
Answer to Question (1):

This question was solved by: Student name: ………………………………… ID: …………..
Did you summarize the information that you gathered: Yes or No
I used the following sources (References) to produce this report:
 Book/magazine/newspaper Title/s: ………………………………………Page No. ……..
 Address of Web Site/s: ……………………………………………….
 Through Discussion with:
(a) Name of person/s: …………………………… his/her job:…………… Date:………….
(b) Name of person/s: …………………………… his/her job:…………… Date:………….
 Other: ……………………………………………………………………………………
If it is coding question, I wrote PHP code in: My Laptop or PC College PC
If it is coding question, I produced the output by: My Laptop or PC College PC
Difficulties that I have encountered while working on this question:
1. …………………………………………………………………………………………
2. …………………………………………………………………………………………
3. …………………………………………………………………………………………
Answer to Question (2):

This question was solved by: Student Name: …………………………………… ID: …………..
Did you summarize the information that you gathered: Yes or No
I used the following sources (References) to produce this report:
 Book/magazine/newspaper Title/s: ………………………………………Page No. ……..
 Address of Web Site/s: ……………………………………………….
 Through Discussion with:
(a) Name of person/s: …………………………… his/her job:…………… Date:………….
(b) Name of person/s: …………………………… his/her job:…………… Date:………….
 Other: ……………………………………………………………………………………
If it is coding question, I wrote PHP code in: My Laptop or PC College PC
If it is coding question, I produced the output by: My Laptop or PC College PC
Difficulties that I have encountered while working on this question:
1. …………………………………………………………………………………………
2. …………………………………………………………………………………………
3. …………………………………………………………………………………………

Page 10 of 11
Issue Date: Thursday, 20th May 2021
University of Technology and Applied Sciences – Nizwa Due date: Wednesday 26th May 2021
Information Technology Department
Course Code and Title: ITDB201, Web Application Development 1
Student ID: ………………. Name: ………………………………………………………… Section No. ( )
Semester 3 - 2020-2021 Marks Obtained: ..........

Your Report should look like the following or even better

Page 11 of 11

You might also like