Session variables when global variables switched off [Sorry, firs t message accidentally fired off to quickly ]

From: Date: Tue, 18 Feb 2003 11:20:11 +0000
Subject: Session variables when global variables switched off [Sorry, firs t message accidentally fired off to quickly ]
Groups: php.db 
Request: Send a blank email to php-db+get-25726@lists.php.net to get a copy of this message
[sorry for the incomplete posting of a couple moments ago. I hit ctl something or other and outlook fired off the e-mail against my wishes!] I am making a section on a web site which requires that visitors log-in. Log-in, password, etc are in an MySQL table. I am using (via a web host) PHP 4.2.2 with global variables turned off. Until now, I have worked with a different host in which global variables were switched on. The way it works The user logs in at index.php. When she does so successfully, index.php returns a menu of links. However, if she clicks on any of those links, which are different pages, she gets a please log-in first message because each page includes... if ($_SESSION['verified'] <> "yes"){ echo "<P><a href='index.php'>Please log in first</a></P>"; exit(); } Returning to index.php requires a log-in again. So, it seems the session variable is not being sent being sent between pages, although it works within the same page. I expect I am missing something obvious. I've made this kind of thing work with global variables on - so I assume I am misunderstanding something related to lack of global variables. I use session_start(); at the top of all pages and session_register($_SESSION['okbabe']); on index.php. Your enlightenment will be highly appreciated. Jeffrey Baumgartner

« previous php.db (#25726) next »