Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old September 10th, 2001, 09:07 AM
cerveza cerveza is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Posts: 1 cerveza User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question apache & php_auth

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!

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > apache & php_auth


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway