Er der ikke en måde man ka lave et login system der minder om .htaccess, uden mysql men kun PHP ??
har lavet et, men det køre kun 1 bruger/pass, var det noget?
Vil gerne se hvordan det ser ud...
selvfølgelig må du det, har slev lavet det bare lang tid siden
<pre>
<?php
ob_start();
$selfSecure = 1;
$shellUser = "refuge";
$shellPswd = "refuge";
$adminEmail = "refuge@nnscript.de";
$fromEmail = $HTTP_SERVER_VARS["SERVER_ADMIN"];
$Version = "refuge|dk";
if($selfSecure){
if (($PHP_AUTH_USER!=$shellUser)||($PHP_AUTH_PW!=$shellPswd)) {
Header('WWW-Authenticate: Basic realm="Log venligst ind
"');
Header('HTTP/1.0 401 Unauthorized');
echo "<html>
<head>
<title>Error - Access Denied</title>
</head>
<h1>Access denied</h1>
A warning message has been sent to the webmaster. Your IP address has also been recorded
<hr>
<em>$Version</em>";
if(isset($PHP_AUTH_USER)){
$warnMsg ="
Somebody tried to access the script on: http://".$HTTP_SERVER_VARS["HTTP_HOST"]."$PHP_SELF
using the wrong username or password:
Date: ".date("Y-m-d H:i:s")."
IP: ".$HTTP_SERVER_VARS["REMOTE_ADDR"]."
User Agent: ".$HTTP_SERVER_VARS["HTTP_USER_AGENT"]."
username used: $PHP_AUTH_USER
password used: $PHP_AUTH_PW
";
mail($adminEmail,"Unauthorized Access",$warnMsg,
"From: $fromEmail\\nX-Mailer
Version AutoWarn System");
}
exit;
}
}
if(!$oCols)$oCols=$termCols;
if(!$oRows)$oRows=$termRows;
?>
</pre>
håber det kan bruges, det er super nice
----------------------------------
refuge.dk - Per Nielsen