How can we register the variables into a Session?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / senthilkumar g
<?
session_start();
$username=$_GET['username'];
$_SESSION['username']=$username;
session_write_close();
?>
Is This Answer Correct ? | 13 Yes | 4 No |
Answer / animesh dutta
<?php
// Start the session
session_start();
?>
<?php
// Set session variables
$_SESSION["favcolor"] = "green";
$_SESSION["favanimal"] = "cat";
echo "Session variables are set.";
?>
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / 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 |
Answer / subrat
$_SESSION[?name?] = ?Chinmay?;
To destroy a session: unset($_SESSION[?name?]);
Is This Answer Correct ? | 5 Yes | 9 No |
how to upload more than 50 mb? i tried but session was expired....certain time .....i was set session duration three days .... how to rectified? if any one know that post ur answer as soon as possible?already i was increase php.ini but not working......
i'm b.com graduate and doing MCM- 1year(Master in Computer Management. i'm very interested in PHP? Please tell me some suggetion and the scope of PHP in the market. My E-mail pawan.register@gmail.com Thanks & Regards Pawan.
What is php and its advantages?
How can you increase the maximum execution time of a script in php?
Questions on OOP concepts 1. What are the access specifiers available in php ? Explain 2. What is object cloning ? 3. What are the differences between interface and abstract class ? 4. What is overloading ? 5. What is overriding ? 6. How to prevent function overriding ? 7. What is the use of "final" keyword ? 8. What is static variable ? How will access a static variable ? What is static class ?
Define about declare construct?
Which framework is best for php?
What is strlen function in php?
WHat is the diff. between PHP4 and PHP5?
6 Answers Clarion Technologies, IBM, OmniNet, Sparkton Infotech,
Hello Friends,I am seeking for a job in php having 9 months. exp.Please suggest any company openings.
Explain php split() function.
Whether One-line comment begin with pound sing(#) in php?