How can we register the variables into a Session?

Answer Posted / tarun

session_start();
$ses_variable="name";
session_register('ses_varaible');


// to access the session
echo $_SESSION['ses_variable'];

Is This Answer Correct ?    6 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is constructors and destructors?

530


How to initiate a session in php?

646


How to create a text file in PHP?

610


Explain the difference between $var and $$var?

521


How can we connect to a mysql database from a php script?

525






How to take a substring from a given string in php?

514


Difference between array_combine and array_merge?

516


armstrong number by using php while number is given by the keyboard.?

1687


What is cURL in PHP?

542


What is the difference between php and javascript?

555


How to create a web form?

541


What is the role of php.ini file?

539


Tell me what is the use of mysql_real_escape_string() function?

531


How can you declare a constant variable in php?

562


What is the different between count() and sizeof() in php?

512