Now we come to the point where you ask me to do your job
Marco van Wijngaarden wrote: ...so as you say it is possible with my version...
Yes, data storage in sessions are available in 4.0.6 as well.
Marco van Wijngaarden wrote:exactly how should i change my code in order to get this working on PHP 4.0.6.....
I won't show you exactly how. Learn yourself. Since you started out typing session_register() and stuff you probably know where to read about it.
Marco van Wijngaarden wrote:also you mention "register_globals" that is my providers setting so i can't change that, right?
Read about
ini_get() and
ini_set(). Use ini_get() to see wether register globals is on or off.
If it is off, you are still not very much in trouble, you just need to use other variables when doing posting and such. I found the following in a comment
here:
Code: Select all
function fn_http_vars_access() {
global $GET_VARS, $POST_VARS, $COOKIE_VARS, $SESSION_VARS, $SERVER_VARS, $ENV_VARS;
$parser_version = phpversion();
if ($parser_version <= "4.1.0") {
$GET_VARS = $GET_VARS;
$POST_VARS = $POST_VARS;
$COOKIE_VARS = $COOKIE_VARS;
$SESSION_VARS = $HTTP_SESSION_VARS;
$SERVER_VARS = $HTTP_SERVER_VARS;
$ENV_VARS = $HTTP_ENV_VARS;
}
if ($parser_version >= "4.1.0") {
$GET_VARS = $_GET;
$POST_VARS = $_POST;
$COOKIE_VARS = $_COOKIE;
$SESSION_VARS = $_SESSION;
$SERVER_VARS = $_SERVER;
$ENV_VARS = $_ENV;
}
}
If sessions still doesn't work as expected, try this:
Code: Select all
function fn_http_vars_access() {
global $GET_VARS, $POST_VARS, $COOKIE_VARS, $SESSION_VARS, $SERVER_VARS, $ENV_VARS;
$parser_version = phpversion();
if ($parser_version <= "4.1.0") {
$GET_VARS = $GET_VARS;
$POST_VARS = $POST_VARS;
$COOKIE_VARS = $COOKIE_VARS;
$SESSION_VARS = &$HTTP_SESSION_VARS;
$SERVER_VARS = $HTTP_SERVER_VARS;
$ENV_VARS = $HTTP_ENV_VARS;
}
if ($parser_version >= "4.1.0") {
$GET_VARS = $_GET;
$POST_VARS = $_POST;
$COOKIE_VARS = $_COOKIE;
$SESSION_VARS = &$_SESSION;
$SERVER_VARS = $_SERVER;
$ENV_VARS = $_ENV;
}
}
...where we access $_SESSION or $HTTP_SESSION_VARS by
reference. That means that any changes you make to the $SESSION_VARS is reflected onto the original array. But I have no experience of using $HTTP_SESSION_VARS, so I'm not sure if that array works like the $_SESSION array. Be sure to call fn_http_vars_access() before processing anything. BTW, you can do this regardless of the setting of register_globals.
You shouldn't use register globals...
Read all the links I have provided in this post. They cover a lot of what you want to know. And when you are done reading, start considering the
PHP Manual a valuable resouce.

You learn best by doing it yourself.
If you are running Windows and want to get hold of a fresh PHP version with mysql and apache, you could try
PHP Home . It installs all necessary things itself and you get to develop on a fresh version of PHP. Then get a host that likes to be up to date...
