In the first case, where it accepts $_POST['userName'] and $userName, the Register globals is on.
The second case is backwards, it only accepts $_POST['userName']. In this case, Register globals is off.
You want to avoid (at any cost) turning on the register globals, because people can inject malicious code into your scripts. If you feel as though you must turn on Register Globals, then all I will say is it is a setting in the php.ini file on the server and you should be able to peruse the php manual and find info on how to do it... That's all I am going to say, because it is a bad idea to turn it on.