I am building my homepage without mysql.so I have to protected some pages,my passwords are kept in a txt file
such as
//txt.txt
jiangdong
jiangdong1
//end of txt file
when I submitted a form contend $pass
//check_admin.php
<?
$filename="txt.txt";
$ok=0;
$myfile=fopen($filename,"r") or die ("can not open file!");
while(!feof($myfile))
{$get=fgets($myfile,$lenth);
//how should I give the right
//lenth of $lenth
if($get==$pass) $ok=1;
}
if($ok)
echo "ok";
?>
I can't get expected result.
because of the lenth is not suitable!!
help!help!
thank you!!