Devo creare un sistema di log in con i file txt. Ho scritto il seguente codice ma di da errore...
quale sarebbe questo errore?

codice:
<?php
if(isset($_POST["utente"]) AND isset($_POST["password"]))
{
  $n_utenti = (int) fread(fopen("utenti/n_utenti.txt","r"),10);
  for($i=0; $i<$n_utenti+1; $i++)
  {
    if(fread(fopen("utenti/$i/utente.txt","r"),20) = = $_POST['utente'])
    {
      if(fread(fopen("utenti/$i/password.txt","r"),20) = = $_POST['password'])
      {
        die ("Sei loggato");
        $utente_loggato = $i;
      }
    }
  }
  {
    die ("Attenzione nome Utente o Password errata");
  }
}
{ 
echo ("<form id=&quot;login&quot; action=&quot;&lt;?=$PHP_SELF?&gt;&quot; method=&quot;post&quot;>
    Utente:
<input name=&quot;utente&quot; type=&quot;text&quot; size=&quot;20&quot; maxlength=&quot;20&quot;>

    Password:
<input name=&quot;password&quot; type=&quot;password&quot; size=&quot;20&quot; maxlength=&quot;20&quot;>


    <input type=&quot;submit&quot; value=&quot;   OK   &quot;>


    <a href=&quot;registrazione.php&quot;>Registrati</a>
</form>");
?>