PHP password problem
Posted: Thu Jan 06, 2005 7:04 am
feyd | Help us, help you. Please use
and here is the passwords.php code:
Thanks in advance.
Mark
feyd | Help us, help you. Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
I am having trouble with the following PHP password files. I have set the permissions 755. The problem is two-fold. I can actually log in with any password. It is not authenticating. The other proglem is that the level of admin "abilities" that is set in the passwords.php file is not recognized.
I also notice, in the first snippet of code, a reference to passwd.txt. Is this something that is supposed to be generated on it's own? In the script I uploaded I did not see a file named that.
Here is the checkpass.php code:Code: Select all
<?php
include('passwords.php');
$pass=strtolower($_GET['pass']);
$dfile='passwd.txt';
if($lines = @file($dfile) or die('none')) {
foreach($lines as $str) {
list($key,$var)= explode("\t", $str);
$data[$key]=$var;
}
echo 'success=';
if(!$data[$pass]) { echo 'none'; }
else{ echo urlencode($data[$pass]); }
// }
?>Code: Select all
<?php
$data['guest'] = 'guest';
$data['admin'] = '*';
?>Mark
feyd | Help us, help you. Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]