compare user and password with md5 in txt?
<p>i have a php file:</p>

<pre><code>&lt;?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'; 
}
?&gt; 
&lt;body&gt; 
&lt;form action="file_handle3.php" method="post"&gt; 
User&lt;input type="text" name="user"/&gt;&lt;br/&gt; 
Password &lt;input type="password" name="password"/&gt; 
&lt;input type="submit" name="submit" value="submit"/&gt; 
    &lt;/body&gt;
</code></pre>

<p>and the file txt : hash.txt the 1st line is hello the second is world</p>

<p>5d41402abc4b2a76b9719d911017c592</p>

<p>7d793037a0760186574b0282f2f435e7</p>

<p>i want to compare do value user input and convert them to md5 then compare with the one in txt file.i have no ideas why my code doesn't output a correct answer even when i type exactly the values (user:hello password:world).Sorry for my bad english</p>
