jwwceo Posted December 13, 2007 Share Posted December 13, 2007 I am having some trouble with Sessions. If I register a session variable like this: $permission ="no"; session_register("permission"); Shouldn't I be able to use $permission on all my pages which have the session start tag a the top??? I have this at the very top of my next page and I get no response: <?php session_start(); echo "{$permission}"; JW Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 13, 2007 Share Posted December 13, 2007 <?php session_start(); // This must be on all pages $string = "Joey"; $_SESSION['name'] = $string; ?> PART 2 <?php session_start(); print "My name is: " . $_SESSION['name']; ?> Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 13, 2007 Share Posted December 13, 2007 Session_register() is depreciated (everyone should have stopped using it in 2002) and only works when register_globals are on. The method that phpSensei posted is the proper way. Also, check your web server log for errors when you have fundamental php code that does not function as expected. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted December 14, 2007 Share Posted December 14, 2007 Mark this topic solved please, I hate seeing it unsolved. Quote Link to comment Share on other sites More sharing options...
jwwceo Posted December 14, 2007 Author Share Posted December 14, 2007 THANK BOTH YOU GUYS FOR THE HELP. LOOKS LIKE THE TUTORIAL I WAS USING IS BIT OLD!!!! 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.