NYCPHP Meetup

NYPHP.org

[nycphp-talk] retro php

David Rydell drydell at worldnet.att.net
Tue Oct 14 10:37:29 EDT 2003


<snip>
I gave both:

session_register($HTTP_SESSION_VARS);

and, e.g.,

session_register($HTTP_SESSION_VARS['S_user_id']);
</snip>

the proper syntax is session_register('variable_name')... from the manual:


The track_vars and register_globals configuration settings influence how the
session variables get stored and restored.

Note: As of PHP 4.0.3, track_vars is always turned on.

If track_vars is enabled and register_globals is disabled, only members of
the global associative array $HTTP_SESSION_VARS can be registered as session
variables. The restored session variables will only be available in the
array $HTTP_SESSION_VARS. Example 1. Registering a variable with track_vars
enabled


<?php
session_register("count");
$HTTP_SESSION_VARS["count"]++;
?>


If register_globals is enabled, then all global variables can be registered
as session variables and the session variables will be restored to
corresponding global variables. Example 2. Registering a variable with
register_globals enabled


<?php
session_register("count");
$count++;
?>


If both track_vars and register_globals are enabled, then the globals
variables and the $HTTP_SESSION_VARS entries will reference the same value.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.525 / Virus Database: 322 - Release Date: 10/9/2003




More information about the talk mailing list