Skip to main content

Html Forms Handling — Part 2 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Html Forms Handling — Part 2 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
30
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
36 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
30

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/30 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 30
★ FPSC ★ PPSC

Which two predefined variables are used to retrieve information from forms?

Question 2 of 30
★ FPSC ★ PPSC

The attack which involves the insertion of malicious code into a page frequented by other users is known as.

Question 3 of 30
★ FPSC ★ PPSC

When you use the $_GET variable to collect data, the data is visible to.

Question 4 of 30
★ FPSC ★ PPSC

Which variable is used to collect form data sent with both the GET and POST methods?

Question 5 of 30
★ FPSC ★ PPSC

Which function is used to remove all HTML tags from a string passed to a form?

Question 6 of 30
★ FPSC ★ PPSC

To validate an e-mail address, which flag is to be passed to the function filter_var()?

Question 7 of 30
★ FPSC ★ PPSC

How many predefined variables does PHP use to authenticate a user?

Question 8 of 30
★ FPSC ★ PPSC

Which of the following PHP function is commonly used when handling authentication via PHP? 1. header() 2. footer() 3. inset() 4. isset()

Question 9 of 30
★ FPSC ★ PPSC

Which of the following are types of PHP authentication implementation methodologies? 1. Hard-coding a login pair directly into the script 2. File-based authentication 3. Data-based authentication 4. PEAR’S HTTP authentication

Question 10 of 30
★ FPSC ★ PPSC

What is the default value of max_input_time directive?

Question 11 of 30
★ FPSC ★ PPSC

What is the default value of the directive max_file_limit?

Question 12 of 30
★ FPSC ★ PPSC

If you want to temporarily store uploaded files in the /tmp/phpuploads/ directory, which one of the following statement will you use?

Question 13 of 30
★ FPSC ★ PPSC

Which superglobal stores a variety of information pertinent to a file uploaded to the server via a PHP script?

Question 14 of 30
★ FPSC ★ PPSC

Which function is used to determine whether a file was uploaded?

Question 15 of 30
★ FPSC ★ PPSC

Which one of the following is the very first task executed by a session enabled page?

Question 16 of 30
★ FPSC ★ PPSC

If session.use_cookie is set to 0, this results in use of.

Question 17 of 30
★ FPSC ★ PPSC

Which one of the following function is used to start a session?

Question 18 of 30
★ FPSC ★ PPSC

What will the function session_id() return is no parameter is passed?

Question 19 of 30
★ FPSC ★ PPSC

Which function effectively deletes all sessions that have expired?

Question 20 of 30
★ FPSC ★ PPSC

Which function is used to transform PHP’s session-handler behavior into that defined by your custom handler?

Question 21 of 30
★ FPSC ★ PPSC

PHP sessions are created using the . . . . . function.

Question 22 of 30
★ FPSC ★ PPSC

When you want to store user data in a session use the . . . . array.

Question 23 of 30
★ FPSC ★ PPSC

Sessions allow you to.

Question 24 of 30
★ FPSC ★ PPSC

A snapshot of the session data can be taken at any time and written out to a file.

Question 25 of 30
★ FPSC ★ PPSC

When the session data is written to a file, it can be read back, decoded and applied to the current session using the . . . . function.

Question 26 of 30
★ FPSC ★ PPSC

session_destroy() instantly destroy elements of the $_SESSION array.

Question 27 of 30
★ FPSC ★ PPSC

Appending session data to an absolute URL does not represent a security risk.

Question 28 of 30
★ FPSC ★ PPSC

If the php.ini register_globals directive is set, session data becomes available in the . . . . namespace.

Question 29 of 30
★ FPSC ★ PPSC

No expiry date is set in the cookie that PHP sets for the session. The session remains current only as long as the browser is active. When the browser is restarted the cookie is not stored. This behavior can be changed by altering . . . . . setting in php.ini file.

Question 30 of 30
★ FPSC ★ PPSC

session_destroy() erases all session variable.

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →