I changed hosting service and when I try to enable register_globals
in PHP.ini
my website behaves in a strange way. Each time I click on a page it downloads a page with this error:
Directive 'register_globals' is no longer available in PHP in Unknown on line 0
How can I enable register_globals directive? I know it is not sure but I should replace a lot of things
DON'T DO IT. There's a reason why this directive was removed. Source Using Register Globals
Warning This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.
So wherever you had $magicalVariable
, now you can do something like this:
$magicalVariable = $_GET['magicalVariable']
$magicalVariable = filter_input(INPUT_GET, 'magicalVariable', FILTER_SANITIZE_STRING)
Rule no.1: Never trust user input!