adplus-dvertising
frame-decoration

Question

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

a.

Username now set to: nachi

b.

Username now set to: System

c.

Username now set to:

d.

Error

Posted under PHP

Answer: (c).Username now set to:

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the following PHP code? Say your previous session username was nachi.

Similar Questions

Discover Related MCQs

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

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

Q. Which function effectively deletes all sessions that have expired?

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

Q. The session_start() function must appear..

Q. What is the return type of session_set_save_handler() function?

Q. Which one of the following statements should be used to disable just the fopen(), and file() functions?

Q. Which one of the following statements should be used to disable the use of two classes administrator and janitor?

Q. What is the default value of max_execution_time directive? This directive specifies how many seconds a script can execute before being terminated.

Q. The memory_limit is only applicable if ___ is enabled when you configure PHP. Fill in the blank.

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

Q. Which Apache directive outputs Apache’s server version, server name, port and compile-in modules?

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

Q. Which directive should we disable to obscure the fact that PHP is being used on our server?

Q. Say I want to change the extension of a PHP file, which of the following statements should I edit to change from .php to .html in the httpd.conf file?

Q. The developers of PHP deprecated the safe mode feature as of which PHP version.