Hiya!
Here comes the problem:
==== begin of index.php ====
<?
include("util.php");
if ($GLOBALS["REQUEST_METHOD"] == "GET") {
do_get();
}
if ($GLOBALS["REQUEST_METHOD"] == "POST") {
do_post();
}
?>
==== end of index.php ====
==== begin of util.php ====
<?
function do_get() {
session_register("lang");
$lang = "en";
echo"
<b>GET</b> requested
<form method=\"post\">
<input type=\"submit\" value=\"Press me!\">
</form>
";
}
function do_post() {
session_register("lang");
if(!isset($lang)) {
$lang = "ru";
}
echo"
<b>POST</b> requested - \"$lang\" language chosen.
<form method=\"post\">
<input type=\"submit\" value=\"Press me!\">
</form>
";
phpinfo();
}
?>
==== end of util.php ====
Running that code I see that session variable being set in do_get(), is NOT set in do_post() though.
Both track_vars and register_globals are enabled.
It looks like scope of variables problem but it should'n be because once being session_register()-ed variables must become global, shouldn't they?
I appreciate any help and/or explanations.
TIA,
alko