Skip to main content

Html Forms Handling — Part 1 MCQs with Explanations

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

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

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

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

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

Question 2 of 40
★ FPSC ★ PPSC

Which one of the following should not be used while sending passwords or other sensitive information?

Question 3 of 40
★ FPSC ★ PPSC

What will be the value of the variable $input in the following PHP code? <?php $input = "Swapna<td>Lawrence</td>you are really<i>pretty</i>!" ; $input = strip_tags ($input, "<i></i>" ); ?>

Question 4 of 40
★ FPSC ★ PPSC

How many validation filters like FILTER_VALIDATE_EMAIL are currently available?

Question 5 of 40
★ FPSC ★ PPSC

Which of the following variables does PHP use to authenticate a user? 1. $_SERVER[‘PHP_AUTH_USER’]. 2. $_SERVER[‘PHP_AUTH_USERS’]. 3. $_SERVER[‘PHP_AUTH_PU’]. 4. $_SERVER[‘PHP_AUTH_PW’].

Question 6 of 40
★ FPSC ★ PPSC

Which function is used to verify whether a variable contains a value?

Question 7 of 40
★ FPSC ★ PPSC

In which authentication method does changing the username or password can be done only by entering the code and making the manual adjustment.

Question 8 of 40
★ FPSC ★ PPSC

The authentication File.txt, the file which stores username and password should be stored ________ the server document root.

Question 9 of 40
★ FPSC ★ PPSC

Which function is used to split a string into a series of substrings, with each string boundary is determined by a specific separator?

Question 10 of 40
★ FPSC ★ PPSC

In which of the following situations does file-based authentication become inconvenient. 1. small list 2. large number of user 3. users are being regularly added 4. static authentication

Question 11 of 40
★ FPSC ★ PPSC

Which is the most powerful authentication method among the four?

Question 12 of 40
★ FPSC ★ PPSC

Which directive determines whether PHP scripts on the server can accept file uploads?

Question 13 of 40
★ FPSC ★ PPSC

Which of the following directive determines the maximum amount of time that a PHP script will spend attempting to parse input before registering a fatal error?

Question 14 of 40
★ FPSC ★ PPSC

Since which version of PHP was the directive max_file_limit available.

Question 15 of 40
★ FPSC ★ PPSC

Which directive sets a maximum allowable amount of memory in megabytes that a script can allow?

Question 16 of 40
★ FPSC ★ PPSC

How many items are available in the $_FILES array?

Question 17 of 40
★ FPSC ★ PPSC

How many ways can a session data be stored?

Question 18 of 40
★ FPSC ★ PPSC

Which directive determines how the session information will be stored?

Question 19 of 40
★ FPSC ★ PPSC

Which one of the following is the default PHP session name?

Question 20 of 40
★ FPSC ★ PPSC

If the directive session.cookie_lifetime is set to 3600, the cookie will live until.

Question 21 of 40
★ FPSC ★ PPSC

Neglecting to set which of the following cookie will result in the cookie’s domain being set to the host name of the server which generated it.

Question 22 of 40
★ FPSC ★ PPSC

What is the default number of seconds that cached session pages are made available before the new pages are created?

Question 23 of 40
★ FPSC ★ PPSC

What is the default time(in seconds) for which session data is considered valid?

Question 24 of 40
★ FPSC ★ PPSC

Which function is used to erase all session variables stored in the current session?

Question 25 of 40
★ FPSC ★ PPSC

Which one of the following statements should you use to set the session username to Nachi?

Question 26 of 40
★ FPSC ★ PPSC

What will be the output of the following PHP code? Say your previous session username was nachi. <?php unset ( $_SESSION [ 'username' ]); printf ( "Username now set to: %s" , $_SESSION [ 'username' ]); ?>

Question 27 of 40
★ FPSC ★ PPSC

An attacker somehow obtains an unsuspecting user’s SID and then using it to impersonate the user inorder to gain potentially sensitive information. This attack is known as.

Question 28 of 40
★ FPSC ★ PPSC

Which parameter determines whether the old session file will also be deleted when the session ID is regenerated?

Question 29 of 40
★ FPSC ★ PPSC

The session_start() function must appear.

Question 30 of 40
★ FPSC ★ PPSC

What is the return type of session_set_save_handler() function?

Question 31 of 40
★ FPSC ★ PPSC

Before you can start processing images with PHP, you must first add the ability to upload images to your administrative form on ________

Question 32 of 40
★ FPSC ★ PPSC

When you’re uploading files you need to set the enctype of the form to __________

Question 33 of 40
★ FPSC ★ PPSC

To check whether a file was uploaded, you look in the _______ superglobal array.

Question 34 of 40
★ FPSC ★ PPSC

To make the ImageHandler class portable you should create a separate file for it called __________

Question 35 of 40
★ FPSC ★ PPSC

DocBlocks are indicated by opening a comment using _________

Question 36 of 40
★ FPSC ★ PPSC

To process the file, you need to break the array from $_FILES into individual values. You can do this using the ________ function.

Question 37 of 40
★ FPSC ★ PPSC

Before you try to process the file, you need to make sure that your $err value is equivalent to _________

Question 38 of 40
★ FPSC ★ PPSC

You use the $_SERVER superglobal and your _______ property to create your path to check.

Question 39 of 40
★ FPSC ★ PPSC

Which function do you have to use to check whether the $path you’ve stored exists?

Question 40 of 40
★ FPSC ★ PPSC

Which one of the following is true about the following line – $obj = new ImageHandler(‘/images/’, array(400, 300));

✓ 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 →