Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Backwards compability in reading requests in PHP

Tags:

php

I am experienced with web development, but not with PHP. My challenge now is therefore that I am about to move an older PHP solution to a server only supporting PHP 5.2.+. The whole solution is using a $id - style to read the request instead of $_REQUEST['id'] or the $_GET..., $_POST...

I wonder if this type of coding is not longer supported, or if there is something I have missed here. After I moved the solution it is not working. The variable will be blank/empty.

Is there an easy way to solve this, or do I have to rewrite?

Thank you very much if you take the time to help.

like image 830
Peaceman71 Avatar asked Jul 10 '26 23:07

Peaceman71


1 Answers

its seam that the older version use Register_globals = on in php.ini

read on it

http://www.peoplecnc.com/register_globals_off.html

its not recommended to use it , and in php5 is off by default,

you can override it by create a file named .htaccess and put this into it:

php_value register_globals 1 

or by put this line in the head of the script (Depreciated in PHP 5.3.0. This deprecated feature will certainly be removed in the future.)

ini_set('register_globals', 'on');

but is not recommended , as you can read in the link.

like image 197
Haim Evgi Avatar answered Jul 13 '26 12:07

Haim Evgi