While, I used something like “$username = $_POST[‘uname’]” in my script, I sawed the php.net said don’t use the “Superglobals”: PHP: Using Register Globals - Manual.
This make me confused, if I cannot use something like ‘$_POST’, what can I use to get the data submitted?:sick:
That page is saying you should use super globals. What it says you shouldn’t use is register_globals, which is a feature that was standard for a while but super unsafe.
Basically what it did was if you submitted a form, with a field ‘uname’ like you have above, you could just use $uname in the script; the consequence was that you could never be certain where a variable came from (did I set it myself, was it posted, was it set as a get parameter, something else?)
Example #9 on the page you linked to is a very good example of how register_globals can be abused.
*throws up obligatory notice about remembering to sanitize data passed through user-accessable superglobals (GET, POST, REQUEST, and some parts of SERVER)