|
in my admin.php
<?php
if (($_POST["userid"] == "") || ($_POST["password"] == ""))
{
echo "admin is called.";
admin();
}
elseif ($_POST["edit"] == true || (accept($_POST["userid"], $_POST["password"])))
{
echo "update is called.";
if ($_POST["update"] == "true")
{ update($_POST); }
edit( $_POST);
}
else
{
echo $_POST["userid"];
echo '$_POST["userid"]'.'haha';
userIDPasswordAdmin($_POST["userid"], $_POST["password"]);
}
?>
the following is the function.
function accept($userid, $password)
{
echo $userid ." accept function " . $password;
//open file
$f_handel = fopen("Utility/Documents/Admin.txt", "rb") or die ("Can not open the admin file.");
while (!feof($f_handel))
{
$UserID = str_replace("\n", '',(fgets($f_handel, 16)));
$PassWord = str_replace("\n", '',(fgets($f_handel, 16)));
echo $UserID ." read file data " . $PassWord;
if ($UserID == $userid && $PassWord == $password)
{
fclose($f_handel);
echo "<br>return true";
return true;
}
}
fclose($f_handel);
echo "<br>return false";
return false;
}
shiqiangchen.com/Mobile/admin.php
this is the page I get confuse.
The string is the same. Why it return false?
|