PHP Language | 10 Minute‐Test 25


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 function is used to remove all HTML tags from a string passed to a form?

A.
remove_tags()
B.
strip_tags()
C.
tags_strip()
D.
tags_remove()

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

None

2.

The authenticationFile.txt, the file which stores username and password should be stored ___ the server document root

A.
Inside
B.
Outside
C.
Within
D.
None of the above

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

If it is not stored outside, the attacker could discover the file through brute force guessing.

3.

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

A.
upload_tmp_dir “/tmp/phpuploads/ directory”
B.
upload_dir “/tmp/phpuploads/ directory”
C.
upload_temp_dir “/tmp/phpuploads/ directory”
D.
upload_temp_director “/tmp/phpuploads/ directory”

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

None

4.

Which one of the following statements can be used to establish port 80 connection with www.nachi.com?

A.
fsockopen(“www.nachi.com”, 80);
B.
sockopen(80,”www.nachi.com”);
C.
fsockopen(80,”www.nachi.com”);
D.
sockopen(“www.nachi.com”, 80);

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

The fsockopen() function establishes a connection to the resource designated by target on port.

5.

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.

A.
session.domain
B.
session.path
C.
session.cookie_path
D.
session.cookie_domain

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

The directive session.cookie_domain determines the domain for which the cookie is valid.

6.

Which function effectively deletes all sessions that have expired?

A.
session_delete()
B.
session_destroy()
C.
session_garbage_collect()
D.
session_expired_delete()

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

None

7.

Which directive determines which degree of server details is provided if the ServerSignature directive is enabled?

A.
ServerAddons
B.
ServerExtra
C.
ServerTokens
D.
ServerDetails

Your Answer: Option (Not Answered)

Correct Answer: Option C

Explanation:

Six options are available: Full, Major, Minimal, Minior, OS, and Prod. If it is set to Full ‘Apache/2.2.11 (Ubuntu) PHP/5.3.2 Server’ will be displayed.

8.

Which one of the following preg PHP functions is used to take a string, and put it in an array?

A.
preg_destroy()
B.
preg_split()
C.
preg_unchain()
D.
preg_divide()

Your Answer: Option (Not Answered)

Correct Answer: Option B

Explanation:

The string is broken up into different values in the array based upon your input.

9.

Which one of the following statements can be used to select the database?

A.
$mysqli=select_db(‘databasename’);
B.
mysqli=select_db(‘databasename’);
C.
mysqli->select_db(‘databasename’);
D.
$mysqli->select_db(‘databasename’);

Your Answer: Option (Not Answered)

Correct Answer: Option D

Explanation:

None

10.

Which of the following methods is used to execute the statement after the parameters have been bound?

A.
bind_param()
B.
bind_result()
C.
bound_param()
D.
bound_result()

Your Answer: Option (Not Answered)

Correct Answer: Option A

Explanation:

Once the statement has been prepared, it needs to be executed. Exactly when it’s executed depends upon whether you want to work with bound parameters or bound results. In the case of bound parameters, you’d execute the statement after the parameters have been bound with the bind_param() method.


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