One of your best options is to Google "PHP login script", you'll find literally hundreds of different code snippits... you'll probably find quite a few searching these boards too A great way to "learn" if that's what you're looking to do.
If you want a script to get you up and running, you can also check out hotscripts.com under PHP -> Scripts & Programs -> User Authentication. Tons of stuff there to do exactly what you're looking to do.
chazze06 you're going to need to store the usernames and passwords somewhere, probably the easiest way to do this is MySQL although it is something else to learn but once you do, you will use it constantly to store all sorts.
Plenty tutorials out there for both php and Mysql, I dont know what you have installed to run your scripts but if it didnt come with MySQL then consider xampp from Apache Friends for all your needs.
$_SESSIONS are also going to be your friend throughout your time with php... I've never once used a cookie* so can't say that your going to need them however thats my own personal pref so you might find a need for them.
*Actually $_SESSION refs are stored as cookies but it all automatic
Kind regards
Dal
__________________
"once upon a midnight dreary, while i pron surfed, weak and weary, over many a strange and spurious site of 'hot xxx galore'. While i clicked my fav'rite bookmark, suddenly there came a warning, and my heart was filled with mourning, mourning for my dear amour," 'Tis not possible!", i muttered, "give me back my free hardcore!" quoth the server, 404."
$query = MYSQL_QUERY("SELECT * FROM `users` WHERE Username = $username_r AND Password = $password_r")
should actually be this:
PHP Code:
$query = MYSQL_QUERY("SELECT * FROM `users` WHERE Username = $username_r")
If a match is found, check to see if the password matches the one submitted. This way of doing things is intended to help prevent some common SQL injection attempts.