Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
14 views

Model Sample Pape-2 (Advanced Web Programming)[1]

Uploaded by

zimamofficial7
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Model Sample Pape-2 (Advanced Web Programming)[1]

Uploaded by

zimamofficial7
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

University of Delhi

V Semester Examination (Model Sample Paper-2)


Subject: Advanced Web Programming (GE-5b)
Unique Paper Code (UPC): 2344000006
Maximum Marks: 90
Time Allowed: 3 Hours

Instructions:

1. All questions are compulsory.


2. Answer the questions within the word limit, if specified.
3. Use examples wherever applicable.

Section A: Objective Questions (1 × 10 = 10 Marks)

(Answer all questions. Each question carries 1 mark.)

1. Which of the following is used to declare a constant in PHP?


a) $constant
b) constant()
c) define()
d) const()

2. In PHP, which operator is used for string concatenation?


a) +
b) .
c) &
d) ++

3. What does $_POST represent in PHP?


a) PHP session data
b) Data sent via HTTP POST method
c) Data sent via HTTP GET method
d) Server environment variables

4. Identify the correct PHP function to connect to a MySQL database.


a) mysql_connect()
b) mysqli_connect()
c) db_connect()
d) database_connect()

5. Which of these is a built-in PHP function for string length?


a) strlen()
b) strlength()
c) getlength()
d) len()

6. JSON stands for:


a) JavaScript Object Notation
b) JavaScript Object Navigation
c) Java Object Notation
d) None of the above

7. Which loop is best suited for traversing arrays in PHP?


a) while
b) for
c) foreach
d) do-while

8. jQuery is primarily used to:


a) Improve database performance
b) Simplify client-side scripting
c) Handle server requests
d) Create CSS styles

9. What is the default port number for MySQL?


a) 3306
b) 8080
c) 21
d) 1521

10. Which PHP superglobal variable holds information about uploaded files?
a) $_FILES
b) $_UPLOAD
c) $_SERVER
d) $_POST

Section B: Short Answer Questions (4 × 10 = 40 Marks)

(Answer any 10 questions. Each question carries 4 marks.)

11. Explain the role of the switch statement in PHP with an example.

12. Differentiate between $_GET and $_POST in handling form data.

13. Write a PHP script to find the largest number among three numbers.

14. What are associative arrays in PHP? Provide an example.

15. Discuss the importance of using prepared statements in PHP for database operations.

16. Write a PHP script to count the number of vowels in a string.

17. Explain the role of the session_start() function in PHP.

18. Write a short note on the importance of JSON in web development.

19. What is AJAX, and how does it integrate with jQuery? Provide a basic example.

20. How can you validate an email address in PHP? Illustrate with a script.

21. Discuss the differences between static and dynamic websites, highlighting the role of PHP in
dynamic sites.

22. Write a PHP script to fetch and display records from a MySQL database table.
Section C: Case Study/Practical Application (10 Marks)

(Answer any 2 questions. Each question carries 20 marks.)

23. Design a PHP script to manage a student record system. The script should allow users to add,
view, update, and delete student records stored in a MySQL database.

24. Create an HTML form that accepts a user’s name, age, and gender. Write a PHP script to
process the form data and display a summary of the input. Additionally, store the data in a
database.

25. Discuss the integration of PHP and jQuery with an example of form validation where fields
are checked for valid input using both client-side and server-side techniques.

26. Explain string handling in PHP in detail. Write scripts to demonstrate the following
operations:

o Reversing a string

o Replacing a substring

o Converting a string to uppercase

You might also like