Oppure

Loading
18/02/13 16:48
lorenzoscarrone
<?php
 include "database.txt";
 $file = fopen("database.txt","r");
 $i=1;
//This get the names of users; 
do
  {
   $username[$i]=fgetc($file);
   $i++;
  }
 while(!feof($file));
//This get the passwords;
 include "passwords.txt";
 $pswd = fopen("passwords.txt","r");
 $i=1;
do
  {
   $password[$i] = fgetc($pswd);
   $i++;
  }
while(!feof($pswd));
// questa sezione confronta i vari usernames e le password e se username corrispondono al numero di array associato--> login()
for($k=1;$k<=$i;$k++)
  {
    if($username[$k]=_POST["user"])
      {
        for($l=1;$l<=$i;l++)
        {
         if($password[$l]=_POST["passwd"])
	 {
	  echo "Login effettuato correttamente <br>";
	  echo "Benvenuto " . $username[$l];
	  include "home.htm";
	 }
	  else
	     {
	      echo "errore.login(password)";
	     }
	 }
	  else
		{
		 echo "errore.login(username)";
		}
	}
  }
?>

errore in output:
PHP Parse error:  syntax error, unexpected '[' in /var/www/prova_php/login.php on line 25

aaa
18/02/13 17:08
pierotofy
if($username[$k] == $_POST["user"])


$_POST, non _POST e ==, non =.
Il mio blog: piero.dev
18/02/13 17:46
lorenzoscarrone
ahah! grazie stavo impazzendo :)
aaa