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 prepare in php?
Echo is used to Display message on screen. Which is used with echo to not output the trailing newline?
Write a program to display reverse of any number?
Can you use both this () and super () in a constructor?
Which function(s) in PHP computes the difference of arrays?
How to open standard output as a file handle?
How the web server interprets php and interacts with the client?
What is the delimiter syntax is PHP's default delimiter syntax
Will react hooks replace redux?
What is session in php why it is use?
When are you supposed to use endif to end the conditional statement?
What is the use of mvc in php?
Explain me what is the meaning of a persistent cookie?
How do I run a php script in windows?
What do you mean range() in php?