On my server, instead of using $_POST[‘username’] to collect data after a form has been submitted, I have simply been able to use $username
so, after a form submission:
echo $username;
would produce the same as:
echo $_POST['username']
I have just moved to a new server and this seems to not work on my new server… is this something that was set in PHP maybe?
I now have the task of going through an entire site otherwise and changing a very form driven site to use the new $_POST[] method (well not new but you know what I mean)
Also, is NOT using $_POST[], as I have been in the past, bad practice and why?
The automatic creation of variables from $_POST, $_GET and $_COOKIE is the effect of the
register_globalsINI directive.It is deprecated due to security issues and is turned off by default on recent installations. I suggest you never rely on this feature and always explicitly specify the original source of your data.