robvan75 Posted October 9, 2008 Share Posted October 9, 2008 Hi, I am new to php and I created two simple php scripts, session_test1.php and session_test2.php.When I view session_test2.php in my browser I get a blank page, I was expecting to see the word John.I am using godaddy as a provider. session_test1.php <?php session_start(); $_SESSION['name']=John; ?> session_test2.php <?php session_start(); echo $_SESSION['name']; ?> Link to comment https://forums.phpfreaks.com/topic/127772-php-sessions/ Share on other sites More sharing options...
DarkWater Posted October 9, 2008 Share Posted October 9, 2008 Add the following lines to the top of both pages: ini_set('display_errors', 1); error_reporting(E_ALL); Link to comment https://forums.phpfreaks.com/topic/127772-php-sessions/#findComment-661372 Share on other sites More sharing options...
kenrbnsn Posted October 9, 2008 Share Posted October 9, 2008 In session_test1.php the string "John" should be in quotes. <?php session_start(); $_SESSION['name']='John'; ?> Ken Link to comment https://forums.phpfreaks.com/topic/127772-php-sessions/#findComment-661386 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.