Link to home
Start Free TrialLog in
Avatar of portal123
portal123

asked on

PHP basic authentication set up

Hello, I would like to set up PHP and Apache configuration for PHP basic authentication. What do I need to configure it? Version php 4.4.7, Apache 1.3.37, MySQL 4.0.27-standard.

Best Regards, portal123
ASKER CERTIFIED SOLUTION
Avatar of dr_dedo
dr_dedo
Flag of Egypt image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of portal123
portal123

ASKER

Thank, dr_dedo. but I prefer to use $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] without session

and generate query from a mysql table that contains user id and password. comparing $_POST variables with user id and password at the query.  I made the following code and it works well at a previous server, but I've changed a new server and it does not work on it.

So, I guess probably some setting problems on Apache and PHP.

Do I need to set anything on PHP and Apache when I use $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] on them ??
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I made a simple mistake on $_SERVER['PHP_AUTH_PW']. I wrote not $_SERVER['PHP_AUTH_PW'] but $_SERVER['PHP_AUTH_PWD'] .

Anyway, thanks both guys....
for($i=1; $i<=100; $i++){
echo "THANKS";
echo "<BR />";
}
Best Regards, portal123