No one will give you a script and work im afraid to say. I wont but i have one that works for what i need.
Now most likely you have the options to either use Cookies or Sessions.
If you need security Sessions would be good.
Now the basics behind a Login Script is
-To allow people to register
-Check if a username exists in the database
Check this stuff out
Mysql - Select
- Insert
- mysql_num_rows
PHP - Sessions (Goto evolt.org they have a good tut on Session Management) Also the manual on all session functions espeacially
session_is_registered to see if a session is registered
Thats about all you need really.
Just make sure your sessions are done correctly so do a few tests first.