Which one of the following statements should you use to set the session username to Nachi?
A. $SESSION[‘username’] = “Nachi”;
B. $_SESSION[‘username’] = “Nachi”;
C. session_start(“nachi”);
D. $SESSION_START[“username”] = “Nachi”;
Answer: Option B
Solution (By Examveda Team)
You need to refer the session variable ‘username’ in the context of the $_SESSION superglobal.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