First of all I'm assuming that to read this tutorial you have some basic familiarity with mysql (that is you know it's a database, you know what phpmyadmin is o...
i know this is an old comment but in case others have the same question in the future, here is what you need to know :)
1. first of all, public_html and the www folder are usually the same - public_html directory will be a shortcut to your www directory or vice versa. this is known as your websites "root" directory. dont worry about the cgi_bin folder. or any others that are not located within your public_html (www) folder unless you are changing your server configurations and know what you are doing.
2. if you upload your php file to your public_html (www) folder, your file will be accessible from yourdomain.com/login.php
3. personally, i would add an additional directory ie "login" inside of my root directory so resulting directory structure would look like www/login, then add my php file in there. this will make your file accessible at yourdomain.com/login/login.php
hope this helps