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 Link to comment https://forums.phpfreaks.com/topic/23824-php-session-variables-help/ 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 :) Link to comment https://forums.phpfreaks.com/topic/23824-php-session-variables-help/#findComment-108200 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"]; Link to comment https://forums.phpfreaks.com/topic/23824-php-session-variables-help/#findComment-108205 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.