Ca3el03 Advanced Php

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Total No. of Questions: 6 Total No.

of Printed Pages:3

Enrollment No......................................

Faculty of Science / Engineering


End Sem Examination Dec-2023
CA3EL03 Advanced PHP
Programme: BCA / BCA- Branch/Specialisation: Computer
MCA (Integrated) Application
Duration: 3 Hrs. Maximum Marks: 60
Note: All questions are compulsory. Internal choices, if any, are indicated. Answers of
Q.1 (MCQs) should be written in full instead of only a, b, c or d. Assume suitable data if
necessary. Notations and symbols have their usual meaning.
Q.1 i. How can you create a custom exception class in PHP? 1
(a) Using the catch block
(b) Using the finally block
(c) By extending the built-in Exception class
(d) By using the try block
ii. When applying filters in PHP, which function should be used to 1
validate an array of data?
(a) filter_var_array() (b) filter_input ()
(c) filter_var() with a loop (d) filter_array_var()
iii. What function is used to delete a file in PHP? 1
(a) delete_file() (b) remove()
(c) unlink() (d) erase()
iv. What PHP function is used to upload files from a web form to the 1
server?
(a) upload_file() (b) receive_file()
(c) move_uploaded_file() (d) save_file()
v. Which PHP function is used to create a new cookie? 1
(a) create_cookie() (b) setcookie()
(c) bake_cookie() (d) store_cookie()
vi. What is a session in PHP? 1
(a) A client-side data storage mechanism
(b) A permanent storage location for data
(c) A temporary server-side storage for user data
(d) A way to store data in cookies

P.T.O.
[2] [3]
vii. What is a key feature of AJAX that distinguishes it from traditional 1 Q.5 Attempt any two:
web applications? i. Write a note on AJAX and explain its significance in web 5
(a) AJAX requires specific web browsers to work development.
(b) AJAX allows asynchronous data exchange with the server ii. Write a program to demonstrate the use of XMLHttpRequest object in 5
(c) AJAX is a programming language AJAX.
(d) AJAX uses only XML for data transfer iii. What is a jQuery selector? How is it used to select elements in HTML? 5
viii. In jQuery, how can you select all paragraphs in an HTML document? 1 Explain with the help of an example.
(a) select(paragraph) (b) $("p")
(c) selectAll("p") (d) getElement("p") Q.6 Attempt any two:
ix. Which jQuery function is used to send HTTP request to a server and 1 i. Explain why session management is important when working with 5
receive a response? PHP forms and databases with the help of example.
(a) request() (b) fetch() (c) ajax() (d) get() ii. Explain the benefits of using PHP, Ajax, and jQuery with MySQL 5
x. When retrieving data from a MySQL database using Ajax, which type 1 together, with the help of example.
of request is commonly used? iii. Write a program using PHP and Ajax to fetch data from a database in a 5
(a) GET (b) REQUEST (c) PUT (d) DELETE web application.

Q.2 Attempt any two: ******


i. Explain various keywords used in Exception handling with the help of 5
a suitable program.
ii. Write a PHP code that demonstrates how to re-throw an exception. 5
iii. Explain difference between filter_var() and filter_var_array() with the 5
help of any program.

Q.3 Attempt any two:


i. Write a program to read a file and count the number of vowels in it. 5
ii. Explain any three regular expression functions with the help of any 5
example.
iii. Write a program to validate a customer’s name and mobile number 5
using regular expressions.

Q.4 Attempt any two:


i. Write program in PHP to create a cookie that stores the user's name 5
and that cookie should expire in one day.
ii. What is a session in PHP? Why are sessions important in web 5
development?
iii. Explain various parameters of the mail() function in PHP with 5
example.
[4]

Marking Scheme how is it used to select elements in HTML – 1.5 Marks


example – 2 marks
Advanced PHP (T) - CA3EL03 (T)
Q.6
i) i. Session management 2 Marks 5
Q.1 c) By extending the built-in Exception class 1
PHP …………… example 3 Marks
ii) a) filter_var_array() 1 ii. Benefits …….. together 2 Marks 5
iii) c) unlink() 1 Example 3 Marks
iv) c) move_uploaded_file() 1 iii. Program …….. in a web application. (As per explanation) 5
v) b) setcookie() 1
vi) c) A temporary server-side storage for user data 1
vii) b) AJAX allows asynchronous data exchange with the server 1 ******
viii) b) $("p") 1
ix) c) ajax() 1
x) a) GET 1

Q.2 i. Use of try, catch, throw, finally 1 Mark 5


Example 1 Mark
ii. Demonstrates to re-throw an exception. (As per explanation) 5
OR iii. Difference …………_array() 3 Marks 5
Program – 2 Marks

Q.3 i. Program to read a file 2.5 Marks 5


Count the number of vowels in it. 2.5 Marks
ii. Three Regular Expression Functions 2.5 Marks 5
Examples of each 2.5 Marks.
OR iii. program to validate a customer’s name 2.5 Marks 5
and mobile number using regular expressions 2.5 Marks

Q.4 i. Program in PHP to create a cookie 3 Marks 5


stores the user's name 1 Mark
cookie expire in one day 1 Mark
ii. Session in PHP 2.5 Marks 5
Sessions importance in web development 2.5 Marks
OR iii. Various parameters of the mail() 3 Marks 5
Example 2 Marks

Q.5 i. Note on AJAX 2.5 Marks 5


its significance in web development 2.5 Marks
ii. Program to ……… object in AJAX. (As per explanation) 5

OR iii. What is jQuery selector 1.5 Marks 5

P.T.O.

You might also like