Re: Subject: php - login and password

From: Date: Sat, 16 Nov 2002 10:50:37 +0000
Subject: Re: Subject: php - login and password
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-16990@lists.php.net to get a copy of this message
Hello - do you mean a HTML form in a popup window, or do you mean the 'Enter Network Password' box - which has 'site' , realm', 'User Name' and Password - and is generated by the webserver .htaccess file? The 1st is accessed using standard variables - if you write a form with a user name box called user < input type = text name="user" > then : $_POST["user"] or $HTTP_POST_VARS["user"] in older versions of PHP. If you mean the password protection is done by authenticating the user by the web server in .htaccess file, then the syntax is different - try printing the value of $HTTP_AUTH_USER I haven't tried this on PHP > 4.2.0, but it might now be called $_SERVER["AUTH_USER"] Don't quote me on the last one but it may well work. To make an .htaccess authentication work, you need also to *generate* 2 files - one called .htusers which contains a list of users, and encrypted passwords which will be accepted, then make a .htaccess file which points to the .htusers file. In .htaccess, there needs to be a line which says AuthUserFile /wwwroot/htdocs/mydirectory/.htusers Put the path to where you store this file instead. You *will* definitely need to read the server (apache?) documentation to do this. Come back to the list if you have problems - I have the docs somewhere but I'm rebuilding my system right now. Hope that helps Neil Smith. At 22:15 15/11/2002 +0000, you wrote:
Message-ID: <20021114224259.71235.qmail@pb1.pair.com> To: php-windows@lists.php.net From: "Rui Monteiro" <RuiSMonteiro@netcabo.pt> Date: Thu, 14 Nov 2002 22:43:07 -0000 Subject: php - login and password I must say that I'm new at this php world. There are some web sites that when you enter a page, a pop-up windows appears requesting a login and password. How can I make a form in php (login page) that searches for the login and password of the page that is requested? I really don't know where the file containing the login or password is stored, but I suppose theres is a rule where to be hold up. Thank you, Rui Monteiro


« previous php.windows (#16990) next »