Examveda

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.

This Question Belongs to PHP >> HTML Forms Handling

Join The Discussion

Related Questions on HTML Forms Handling