How can you handle cookies and sessions? Illustrate with examples.[5]
2.
What is HTTP authentication? How is it done?[5]
Debugging PHP
1.
What is the error handler? Write a program to demonstrate error handler function.[5]
File Handling
1.
Write a program to parse a CSV file and display the content in the file.[5]
Handling Forms
1.
What are the response headers? Create a PHP login form that contains username, password and a login type field defined by dropdown menu. The login type options can be normal or admin. Now, write a function for implementing the login event. The event should be redirected to admin.php if the login credentials match and if the login type is admin otherwise it should be redirected to hello.php. Create a proper database connection based on your own assumption.[10]
2.
Differentiate GET method from POST method with examples.[5]
Introduction
1.
Why is PHP a loosely typed language? How is the for loop different from the foreach loop? Write a PHP program to demonstrate the use of both loops.[10]
Objects
1.
What is anonymous class? Write a program to demonstrate the use of anonymous classes.[5]
2.
Write a program to create a class Employee with some attributes and methods. Create an object of the class and display some output using any method in the class.[5]
Strings and Arrays
1.
How are indexed arrays different from associative arrays? Write a PHP program to demonstrate the conversion between array and variables.[10]
2.
Write a program that will read your name as input string. Access and display the individual characters in the name string.[5]
Working with Database
1.
Consider you have student records in a database table. Now create a PHP page with delete button action and a text field. The button should delete a record if it matches the name of the student entered in the text field. Use your own assumption for the database table.[5]