Authentication through a login form

From: Date: Sat, 27 Jan 2001 09:23:45 +0000
Subject: Authentication through a login form
Groups: php.general 
Request: Send a blank email to php-general+get-36966@lists.php.net to get a copy of this message
Hi Patrick, I had to implement the system you are talking about. I wanted to avoid working with sessions, cookies and all the stuff, just make sure it could work in all configurations with minimal requirements. here is what you could do: 1. Build your login page as a form 2. Check the user name and password (in my case, against a mySQL DB) 3. If credentials are OK, give access to the page(s) requested. I got the trick from someone in the PHP list: do a fopen like this http://user:password@yourdomain.com/protected_stuff Replace user name and password according to your password file. Even if users know the actual location of the files and they try to bypass your authentication form they will get the pop-up window. They need to authentify themselves before. (You may use a sigle user name and password to satisfy all requests). Hope this helps. Regards, ----------------------------------------- I want to replace the popup dialog box that occurs when a user accesses a password protected area, with a login screen. How do I do that? Someone told me I had to use a cookie to say the person is logged on and read it whenever I needed to verify their access. Is it possible to trap the request made to the browser for a username/password and then pass these back to the server whenever the server requires authentication? ======================================================================= Patrick Dunford, Christchurch, NZ - http://pdunford.godzone.net.nz/ Blessed is the man who does not walk in the counsel of the wicked or stand in the way of sinners or sit in the seat of mockers. -- Psalm 1:1 http://www.heartlight.org/cgi-shl/todaysverse.cgi?day=20010125 ======================================================================= Created by Mail2Sig - http://pdunford.godzone.net.nz/software/mail2sig/

« previous php.general (#36966) next »