View Single Post
  #1  
Old 3rd November 2005, 22:41
Joe-Montana Joe-Montana is offline
Junior Member
 
Join Date: Oct 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default .htaccess PHP - Hobe it make sence.

Hey All

i would like to use .htaccess to protect a folder, i know how to do it with the, "htpasspwd" and put the .htaccess in the folder.

Is there any way that i can get htaccess to include a php file to check user and password. instead of using the htpasspwd file


##### if u know what i mean ################

AuthName "restricted stuff"
AuthType Basic
AuthUserFile userfile.php

require valid-user

####################

########## userfile.php #######
<?php

//prevents caching
header("Expires: Sat, 01 Jan 2000 00:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: post-check=0, pre-check=0",false);
session_cache_limiter();
session_start();

require('../../siteuser/config.php');
require('../../siteuser/functions.php');

if (allow_access(user) != "yes") {
{
include ('../../siteuser/no_access.html');
exit;
}
?>

Hobe it make sence.

Best Regard

Joe Montana
Reply With Quote
Sponsored Links