i wish to set up a file called check.php what this doe sit check a set of php pages all which include this file, what this script does to begin wiht is to check the variable $logged and as default it should be out and if it is out and a page they have accessed needs them to be logged in , it auto takes them to the login page, whihc they can then choose to register, to login i need to check usernames and passwords against an sql table , once logged in the logged var turns to in and in the session it needs to store their username id, form the table and their rank could pyro or somebody help me where possible so i can achieve this, maybe step by step guide somehere? thanks, luke ?