Original: Kevin Yang
For a long time, the PHP as one of the biggest selling points of the server-side scripting language will automatically establish a global variable for the value submitted from the form. In PHP 4.1, PHP producers have recommended an alternative to submitting data. In PHP 4.2, they canceled the old approach! As I explained in this article, the purpose of making such changes is for safety considerations. We will study new practices for PHP in handling form submission and other data, and explain why this will increase the security of the code.
What is wrong here?
Take a look at the PHP scripts below, it is used to authorize access to a web page when the username and password is correct:
PHP
// Check the username and password
IF ($ usrname == 'kevin' and $ password == 'secret')
$ authorized = true;
?>
php if (! $ authorized):?>
please enter your username and password: p>