Web Programming Final Exam: 1. Answer The Following Questions
Web Programming Final Exam: 1. Answer The Following Questions
Web Programming Final Exam: 1. Answer The Following Questions
University of Palestine
Faculty of Applied Engineering and Urban Planning
Software Engineering Department
Date:.WED,11.02.09 | 9:00-11:30
Exam:
Student:
1. HTTP is a stateless protocol. That is, it doesnt allow servers to keep clients state. However,
sessions and cookies were developed to tackle this issue. Explain.
2. Compare GET and POST in terms of method of sending information, usage, and limitations.
Give a simple example in both cases.
<script>
<js>
<javascript>
<scripting>
var
var
var
var
txt
txt
txt
txt
=
=
=
=
new
new
new
new
Array("tim","kim","jim")
Array:1=("tim")2=("kim")3=("jim")
Array(1:"tim",2:"kim",3:"jim")
Array="tim","kim","jim"
&
!
$
#
Page
1 of 4
[ 30 Marks ]
<!--include file="time.inc"-->
<% include file="time.inc" %>
<?php include_file("time.inc"); ?>
<?php require("time.inc"); ?>
function myFunction()
new_function myFunction()
create myFunction()
None of the above.
$obj.foo()
$obj->foo()
a+b
$this->foo()
8. The final visibility means that the method or the class is accessed:
a)
b)
c)
d)
From
From
From
From
Page
2 of 4
[50 Marks ]
Figure 1 shows a part of the database of the Employee Affairs System of the University
of Palestine. It simply contains two related tables; employees and departments where
one employee can work in one department, and one department can contain many
employees. Figure 2 shows two web pages we consider. The first one titled as
add.employee.php. The second is process.php. Figure 3 shows an HTML source of the
page add.employee.php.
ID
name
Employee
name
ID
Works in
Department
gender
php
add.employee.php
php
process.php
<html>
<body>
<form method="POST" action="process.php">
Name:<input type="text" name="name" size="20">
<br/>
ID:<input type="text" name="ID" size="20">
<br/>
Department:<select size="1" name="department"></select>
<br/>
Gender: <select size="1" name="gender">
<option selected value="Male">Male</option>
<option>Female</option>
</select>
<br/>
<input type="submit" value="submit" name="Submit"><input
type="reset" value="reset" name="reset">
16. </form>
17. </body>
18. </html>
Page
3 of 4
Assumptions:
-
Notes:
-
Your solution MUST handle errors using try and catch exception mechanism.
It is recommended you provide an object oriented solution.
Requirements:
1)
-
2)
[10 Marks ]
[10 Marks ]
3)
[30 Marks ]
Write a php code that adds values inserted in the form of add.employee
to the system database. This php code shall be encapsulated within process.php.
A success message shall be shown when added successfully. Otherwise, a failure
message should be shown accompanying the error type.
Page
4 of 4