venky_2_2000 Posted October 13, 2006 Share Posted October 13, 2006 Hi Friends,I'm new to php , Need help with PHP sessions variables.I have two pages main.php and page.phpI would like to register a session variable in main.php and would like to retirve its value in page.phphow can i do that .Please help me with this .Thanks,Venky Quote Link to comment Share on other sites More sharing options...
joshi_v Posted October 13, 2006 Share Posted October 13, 2006 Hi,If main.php register a session variable and assign a value to itsesssion_register("session_name");$_SESSION["session_name"] = "Assign value";in page.php you can access this by printing or by assigning this session variable to another variable.echo $_SESSION["session_name"];$some_variable=$_SESSION["session_name"];Happy Coding :) Quote Link to comment Share on other sites More sharing options...
extrovertive Posted October 13, 2006 Share Posted October 13, 2006 [quote author=venky_2_2000 link=topic=111366.msg451244#msg451244 date=1160719670]Hi Friends,I'm new to php , Need help with PHP sessions variables.I have two pages main.php and page.phpI would like to register a session variable in main.php and would like to retirve its value in page.phphow can i do that .Please help me with this .Thanks,Venky[/quote]//main.phpsession_start();$_SESSION["test"] = " my message";//page.phpsession_start();echo $_SESSION["test"]; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.