lorenzoscarrone (Normal User)
Pro
Messaggi: 92
Iscritto: 16/11/2011
|
Codice sorgente - presumibilmente Php |
<?php include "database.txt"; $file = fopen("database.txt","r"); $i=1; //This get the names of users; do { $username[$i]=fgetc($file); $i++; } //This get the passwords; include "passwords.txt"; $pswd = fopen("passwords.txt","r"); $i=1; do { $password[$i] = fgetc($pswd); $i++; } // 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:
Codice sorgente - presumibilmente PHP |
PHP Parse error: syntax error, unexpected '[' in /var/www/prova_php/login.php on line 25
|
|
|
pierotofy (Admin)
Guru^2
Messaggi: 6230
Iscritto: 04/12/2003
|
Codice sorgente - presumibilmente Plain Text |
if($username[$k] == $_POST["user"])
|
$_POST, non _POST e ==, non =.
|
|
lorenzoscarrone (Normal User)
Pro
Messaggi: 92
Iscritto: 16/11/2011
|
ahah! grazie stavo impazzendo
|
|