+1(978)310-4246 credencewriters@gmail.com
  

Description

Q1: Write a PHP program to count the number of even and odd elements for the given array (2, 3, 4, 5, 6)

Q2: Write HTML and PHP code to create a Form similar to the one in the picture.

When the user press submit, the content will be sent to “Register.php”.

In Register.php document, if the user clicks submit and the checkbox has been selected, display the first name and last name as following.

However, if the user clicks submit and the checkbox has not been selected the following result will be shown.

Q3:You have the following HTML page that contains an input field for the user to enter his/her Email and a submit button:

Enter your Email:

The source code for process.php page is below. The page is simply displays the entered email.

echo $_POST[“Email”];

Suppose that an attacker types the following into the Email field:

What will happen? [0.5 mark]

What do we call this type of attack? [0.5 mark]

Re-write process.php so, it prevents this attack.[0.5 mark]

Q4:Create a MySQL database table named Employees as the following.

Write a PHP page that retrieves all employees’ First_name and Last_name who work in IT department.

College of Computing and Informatics
Assignment 2
Deadline: Tuesday 30/03/2021 @ 23:59
[Total Mark for this Assignment is 5]
Student Details:
Name: ###
ID: ###
CRN: ###
Instructions:
•
•
•
•
•
•
•
•
•
•
You must submit two separate copies (one Word file and one PDF file) using the Assignment Template on
Blackboard via the allocated folder. These files must not be in compressed format.
It is your responsibility to check and make sure that you have uploaded both the correct files.
Zero mark will be given if you try to bypass the SafeAssign (e.g. misspell words, remove spaces between
words, hide characters, use different character sets or languages other than English or any kind of
manipulation).
Email submission will not be accepted.
You are advised to make your work clear and well-presented. This includes filling your information on the cover
page.
You must use this template, failing which will result in zero mark.
You MUST show all your work, and text must not be converted into an image, unless specified otherwise by
the question.
Late submission will result in ZERO mark.
The work should be your own, copying from students or other resources will result in ZERO mark.
Use Times New Roman font for all your answers.
Question One
Pg. 01
Learning
Outcome(s):
Question One
1 Mark
Write a PHP program to count the number of even and odd elements for the
given array (2, 3, 4, 5, 6)
5. Build web
applications using
PHP or similar
languages.
Question Two
Pg. 02
Learning
Outcome(s):
Question Two
1.5 Marks
Write HTML and PHP code to create a Form similar to the one in the picture.
5. Build web
applications using
PHP or similar
languages.
When the user press submit, the content will be sent to “Register.php”.
In Register.php document, if the user clicks submit and the checkbox has been
selected, display the first name and last name as following.
However, if the user clicks submit and the checkbox has not been selected the
following result will be shown.
Question Three
Pg. 03
Learning
Outcome(s):
Question Three
1.5 Marks
You have the following HTML page that contains an input field for the user to
5. Build web
enter his/her Email and a submit button:
applications using
PHP or similar
languages.
Enter your Email:
The source code for process.php page is below. The page is simply
displays the entered email.
Suppose that an attacker types the following into the Email field:
for (i = 0; i < 5; i++) alert("Hello! I am an alert box!"); I. What will happen? [0.5 mark] II. What do we call this type of attack? [0.5 mark] III. Re-write process.php so, it prevents this attack. [0.5 mark] Question Four Pg. 04 Learning Outcome(s): Question Four 1 Mark Create a MySQL database table named Employees as the following. 2. Design and manipulate web databases. 5. Build web applications using PHP or similar languages. Write a PHP page that retrieves all employees ’First_name and Last_name who work in IT department. Purchase answer to see full attachment

  
error: Content is protected !!