Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is data structure in php?

1014


What is the difference between array_map () and array_shift ()?

1038


What is session in c#?

998


What is the best practice for running mysql queries in php? Consider the risk of sql injection.

1068


What is a definer in mysql?

975


What is $_ get and $_ post in php?

1072


What is csrf token and how it works?

1003


Tell me how to retrieve a cookie value?

1022


How come the code works, but doesn’t for two-dimensional array of mine?

1056


How to get the ip address of the client?

9175


Explain the difference between mysql_connect and mysql_pconnect?

917


Tell me what is the difference between get and post?

972


How to include variables in double-quoted strings in php?

973


How to remove white spaces from the beginning and/or the end of a string in php?

986


What is the main difference between require() and include()?

980