How can we register the variables into a Session?
Answer Posted / ramesh n
If you want to register a username as a session variable
means, There are 3 ways done in a job
First way
session_start();
$username=$_GET['username'];
session_register('username');
Second Way
session_start();
$username=$_GET['username'];
$HTTP_SESSION_VARS['username']=$username;
Third Way
session_start();
$username=$_GET['username'];
$_SESSION['username']=$username;
| Is This Answer Correct ? | 53 Yes | 5 No |
Post New Answer View All Answers
What is the difference between query and inquiry?
What is class extend in php?
How will you calculate days between two dates in PHP?
Tell me what is the use of "enctype" attribute in a html form?
What are the features of object-oriented programming in php?
What are the differences between php constants and variables?
What is the Pipe Symbol represented?
Should I learn php before wordpress?
how can i develop forum code? any one pleale help me on this question
Tell me what are the different types of errors in php?
How can we set and destroy the cookie in php?
Explain what are psrs? Choose 1 and briefly describe it?
Is php 7 backwards compatible?
Name some of the popular frameworks in php.
How to get the length of string?