Re: Login Script

From: Date: Mon, 19 Jul 2004 19:56:00 +0000
Subject: Re: Login Script
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-191064@lists.php.net to get a copy of this message
Hello Brian, Take a look at setcookie() in the PHP manual. The algorithm is pretty simple. Once the user submits the form, you compare form data with the data in the database. If the password matches, then set a cookie with the username (using setcookie()). Then you'll just have to check if the cookie is set - if(isset($_COOKIE['username'])) {...} - and if it's set, proceed to user page; if not, display the login form again. -- Best regards, Cosmin

« previous php.general (#191064) next »