私はphpファイルを持っています:
<?php
if (isset($_POST['submit'])) {
$file_name = 'hash.txt';
$user = md5($_POST['user']);
$password = md5($_POST['password']);
$handle = fopen('hash.txt',"r");
$read_file = file($file_name);
if ($user == $read_file[0] and $password == $read_file[1]) {
echo 'correct !';
} else {
echo 'incorrect !';
}
} else {
echo 'please input something';
}
?>
<body>
<form action="file_handle3.php" method="post">
User<input type="text" name="user"/><br/>
Password <input type="password" name="password"/>
<input type="submit" name="submit" value="submit"/>
</body>
およびファイル txt : hash.txt 1 行目は hello で、2 行目は world です
5d41402abc4b2a76b9719d911017c592
7d793037a0760186574b0282f2f435e7
ユーザー入力の値を比較してmd5に変換し、txtファイルの値と比較したい.値を正確に入力してもコードが正しい答えを出力しない理由がわかりません(user:hello password:world )私の下手な英語でごめんなさい