Hi All,
Having reinstalled PHP from 4.01 to 4.3.4, I am having problems with:
1) setting register_globals to "On"
2) setting the value of a session variable passed thru from the url.
FYI, this is based on the windows version running Apache.
1)
I need register_globals = "On" because of my previou scripts. When it's set, this is clearly not indicated when displaying phpinfo(), but looking in my php.ini I have definately set it. I have checked everything, from the path of php.ini to converting php to the older version.
However, when I switch the PHP installation to CGI, it works! Is this the only option?
2)
register_globals = "On". This problem is more of a concern as I can not find an easy solution. Imagine you have two scripts.
Scenario 1
//Script 1:
//registers a session variable and set it with a value.
session_register("v");
$v = 12;
//Then it links off to script 2
<a href="script2.html>"Go to script 2</a>
//Script 2:
//Displays the variable. No problem.
echo "$v";
Scenario 2
//Script 1:
//register a session variable but no value is set.
session_register("v")
//Then it links off to script 2, setting $v at this point
<a href="script2.html?v=12>"Go to script 2</a>
//Script 2:
//Displays the variable. Problems.
echo "$v";
I understand the variable is in $_GET, but having set register_globals = "On" I thought this can be avoided. Before my new installation, both scenarios displayed the variable without difficulty.
I hope someone can help, and what feedback I get will tell me the latest PHP installation is more flexible.
Thanks in advance
phpbuild-it