|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
I'm having some problems with the configuration of my apache server. I wan't to use php_auth to control users from seeing pages in a directory but I just can't get it to work. This is the code I use:
<?php if (!isset($PHP_AUTH_USER) && !isset($PHP_AUTH_PW)) { header("WWW-Authenticate: Basic realm=\"My realm\""); Header("HTTP/1.0 401 Unauthorized"); echo "<html><body bgcolor=ffffcc>"; echo "You must have a username and password to see this sight"; exit; } else if(($PHP_AUTH_USER=="kill-9_users") && ($PHP_AUTH_PW=="tutorial")) { echo "Loged in Welcome to my site"; } else { header("WWW-Authenticate: Basic realm=\"Your site\""); Header("HTTP/1.0 401 Unauthorized"); echo " <html><body bgcolor=ffffcc> You must have access to view this page"; } ?> It's works fine on another apache server, but not on mine. PS: I can use .php-files on my server (php4). Thanx anyone who can help me! |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > apache & php_auth |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|