Search for question
Question

QUESTION ONE

(45 MARKS)

1.1 How does the combination of cookies and sessions play a role in creating a

dynamic user experience in a PHP web application, and what are some of the factors

to consider when implementing this functionality? Can you provide a high-level

overview of the concept, with a focus on the challenges and trade-offs involved, rather

than specific code examples?

(10)

1.2 Write a Menu-Driven program that performs addition, subtraction, multiplication or

division depending on the user's choice. The expected output should be as shown on

the form below

(15)

Expected Output

Your Result

2

Enter your First num 12

Enter your Second num 6

Select Your Choice

Show Result

1.3 How can you write a PHP program that allows a user to input and submit student

enrollment number, name, birth date, contact number, and email address through a

form and then validate all the fields before inserting the data into a MySQL database?

Additionally, the program should check for proper email format and ensure that the

enrollment number is unique in the database before insertion. To make the task more

challenging, the program should also have the ability to edit and delete existing

records in the database based on the enrollment number, while ensuring data integrity

and consistency. Can you also include error handling mechanisms to handle invalid

input and unexpected exceptions?

(20)

Fig: 1