PHP Language | 10 Minute‐Test 23


Instruction

  • Total number of questions : 10.
  • Time alloted : 10 minutes.
  • Each question carry 1 mark.
  • No Negative marks
  • DO NOT refresh the page.
  • All the best :-).

1.

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

A.
$BOTH
B.
$_BOTH
C.
$REQUEST
D.
$_REQUEST

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

None.

2.

Which of the following are types of PHP authentication implementation methodologies?
i) Hard-coding a login pair directly into the script
ii) File-based authentication
iii) Data-based authentication
iv) PEAR’S HTTP authentication

A.
ii) and iii)
B.
i) and iv)
C.
ii), iii) and iv)
D.
All of the mentioned

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

None

3.

What is the default value of the directive max_file_limit?

A.
10 files
B.
15 files
C.
20 files
D.
25 files

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

None

4.

What is the default port number of HTTP’s?

A.
70
B.
80
C.
90
D.
100

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

None

5.

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

A.
Session
B.
Cookie
C.
URL rewriting
D.
Nothing happens

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

None

6.

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..

A.
session-fixation
B.
session-fixing
C.
session-hijack
D.
session-copy

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

You can minimize this risk by regenerating the session ID on each request while maintaining the session-specified data. PHP offers a convenient function named session_regenerate_id() that will replace the existing ID with a new one.

7.

Suppose all web material is located within the directory /home/www. To prevent users from viewing and manipulating files such as /etc/password, which one of the following statements should you use?

A.
open_dir = “/home/www/”
B.
open_dir = /home/www/
C.
open_basedir = /home/www/
D.
open_basedir = “/home/www/”

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

None

8.

Which one of the following preg PHP function is used to do a find and replace on a string or an array?

A.
preg_replace()
B.
preg_find()
C.
preg_find_replace()
D.
preg_findre()

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

None

9.

Which one of the following statements is used to create a table?

A.
CREATE TABLE table_name (column_name column_type);
B.
CREATE table_name (column_type column_name);
C.
CREATE table_name (column_name column_type);
D.
CREATE TABLE table_name (column_type column_name);

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

None

10.

Which one of the following method is used to retrieve the number of rows affected by an INSERT, UPDATE, or DELETE query?

A.
num_rows()
B.
affected_rows()
C.
changed_rows()
D.
new_rows()

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

The method num_rows() is only useful for determining the number of rows retrieved by a SELECT query. But to retrieve the number of rows affected by INSERT, UPDATE, or DELETE query, use affected_rows().


Submit your test now to view the Results and Statistics with answer explanation.