matching input to an external file
<p>I have designed a registration page and I now need to take the input from the login page and match it to an external file. (I understand MySQL is easier, but this is for a project and I <em>cannot</em> use MySQL at all.)</p>

<p>I have on the external file:</p>

<pre><code>fname, sname, username, password, e-mail
</code></pre>

<p>I need to verify the username and password on my txt file. My login pages looks like this:</p>

<pre><code>&lt;form action="logon.php" method="POST"&gt;
    &lt;p&gt;Username: &lt;input type="text" name="username"/&gt;&lt;/p&gt;
    &lt;p&gt;Password:  &lt;input type="password" name="password"/&gt;&lt;/p&gt;
    &lt;input type="submit" value="Submit"&gt;
&lt;/form&gt;
&lt;a href="register.php"&gt;Register Here&lt;/a&gt;
&lt;?php               
$username= $_POST['username'];
$password= $_POST['password'];
$contents = file_get_contents($file);
$arrangefile = preg_split( '/\n/' , $contents );
$found = false;

foreach ( $arrangefile as $items ) {
   $data = explode ( ',' , $items );
}
} ?&gt; 
</code></pre>
