if you use this script do not use it for anything that is secure information. the checklogin.php looks at the database and if only one result is found it creates a session called "$username". To check if the user has logged in the scripts looks for any session that is called $username. this could be easily hacked as anybody could make a session using there own script that creates the session! ALSO... the database is open to sql attack so google this to find out how to prevent it !!!