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']);
?>
<?php
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
Answer: Option C
Solution(By Examveda Team)
To delete the session variable ‘username’ we use the unset() function.Related Questions on HTML Forms Handling
Which two predefined variables are used to retrieve information from forms?
A. $GET & $POST
B. $_GET & $_POST
C. $__GET & $__POST
D. GET & POST
A. basic sql injection
B. advanced sql injection
C. cross-site scripting
D. scripting
When you use the $_GET variable to collect data, the data is visible to.
A. none
B. only you
C. everyone
D. selected few
When you use the $_POST variable to collect data, the data is visible to.
A. none
B. only you
C. everyone
D. selected few
Join The Discussion