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: <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
From: "Rui Monteiro" <[EMAIL PROTECTED]>
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

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to