On Tue, Aug 13, 2002 at 03:18:42PM +0200, Petre Agenbag wrote:
> I have register_golbals = on, BUT, I want to find a way to code that I
> know will always work, regardless of register_globals or cookies, so
> that I am only dependant on the trans-sid ( but If I could rule that out
> too, it would be even better)

This example assumes the machine is running PHP >= 4.1.0 allowing use of
$_SESSION rather than $HTTP_SESSION_VARS.  Adjust as needed.


  if ( !isset($SessionID) ) {
     #  This likely means that register globals is off.
     #  So, loop through the session vars and create regular vars.
     while ( list($Key, $Val) = each($_SESSION) ) {
        $$Key = $Val;



               PHP classes that make web design easier
        SQL Solution  |   Layout Solution   |  Form Solution  | |
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to