Hello.
I have had someone who's had problems with one of our scripts.
He is running it on a Windows box, and it was just not working.
He discovered the following:
I have solved it! Your code is no longer compatible with the PHP4 OPTIMIZED
INI file. Add these 2 lines to index.php and the script works perfectly:
$PHP_SELF=$HTTP_SERVER_VARS["PHP_SELF"];
$action=$HTTP_GET_VARS["action"];
Here is the reason from the official documentation:
;;;;;;;;;;;;;;;;;;;
; About this file ;
;;;;;;;;;;;;;;;;;;;
;
; This is the 'optimized', PHP 4-style version of the php.ini-dist file.
; For general information about the php.ini file, please consult the php.ini-dist
; file, included in your PHP distribution.
;
; This file is different from the php.ini-dist file in the fact that it features
; different values for several directives, in order to improve performance, while
; possibly breaking compatibility with the standard out-of-the-box behavior of
; PHP 3. Please make sure you read what's different, and modify your scripts
; accordingly, if you decide to use this file instead.
;
; - allow_call_time_pass_reference = Off
; It's not possible to decide to force a variable to be passed by reference
; when calling a function. The PHP 4 style to do this is by making the
; function require the relevant argument by reference.
; - register_globals = Off
; Global variables are no longer registered for input data (POST, GET, cookies,
; environment and other server variables). Instead of using $foo, you must use
; $HTTP_POST_VARS["foo"], $HTTP_GET_VARS["foo"], $HTTP_COOKIE_VARS["foo"],
; $HTTP_ENV_VARS["foo"] or $HTTP_SERVER_VARS["foo"], depending on which kind
; of input source you're expecting 'foo' to come from.
; - register_argc_argv = Off
; Disables registration of the somewhat redundant $argv and $argc global
; variables.
; - magic_quotes_gpc = Off
; Input data is no longer escaped with slashes so that it can be sent into
; SQL databases without further manipulation. Instead, you should use the
; function addslashes() on each input element you wish to send to a database.
; - variables_order = "GPCS"
; The environment variables are not hashed into the $HTTP_ENV_VARS[]. To access
; environment variables, you can use getenv() instead.
I was hoping someone could explain this to me.... when I attempt to add what he suggested to my own copy (linux box) the script will not work. But, it does for him (under windows).
Any ideas, thoughts, knowledge on this?
Thanks.
JbA