View Single Post
Old 10-23-2005, 08:23 AM  
adultseo
Confirmed User
 
Join Date: Jun 2005
Location: The Netherlands
Posts: 365
Include in your headers:


PHP Code:
 
include('authenticate.php'); 


File authenticate.php:


PHP Code:
 
<?php 

function authenticate() { 
    
header('WWW-Authenticate: Basic realm="Admin"'); 
    
header('HTTP/1.0 401 Unauthorized'); 
    print 
"NOT AUTHORIZED"
    exit; 
  } 


if (!isset(
$_SERVER['PHP_AUTH_USER'])) { authenticate(); } else { 
$result mysql_query("SELECT * FROM user_table WHERE username='$_SERVER[PHP_AUTH_USER]' and password='$_SERVER[PHP_AUTH_PW]' LIMIT 1"); 
if (
mysql_num_rows($result)) { 
$user mysql_fetch_array($resultMYSQL_ASSOC); 
} else { 
authenticate(); 
}} 

?>


Best Regards,
Adult SEO
__________________
The key to get ranked one in Google is to provide the best.
adultseo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote