Mi da un errore:
Warning: stristr() [function.stristr]: Empty delimiter. in /web/htdocs/www.miosito.it/home/offline/abc/riservata/login.php on line 8
Warning: stristr() [function.stristr]: Empty delimiter. in /web/htdocs/www.miosito.it/home/offline/abc/riservata/login.php on line 8
Warning: stristr() [function.stristr]: Empty delimiter. in /web/htdocs/www.miosito.it/home/offline/abc/riservata/login.php on line 8
UserId o Passwd non inserite. Riprovare
il codice ora è cosi
Grazie!Codice PHP:<?php
session_start();
if (isset($_POST["invio"])) {
$puntatore = fopen("testi/pasx.txt", "r");
$trovato = 0;
while ((!feof($puntatore)) && (!$trovato)) {
$linea = fgets($puntatore);
$trovato = stristr($linea, $_POST["userid"]);
$puntatore++;
}
if (empty($_POST['userid']) || empty($_POST['passwd'])) { echo 'UserId o Passwd non inserite. Riprovare'; die(); }
fclose($puntatore);
list($nomeutente, $password) = split("~:~", $linea);
if (($trovato) && ($_POST["passwd"] == trim($password))) {
session_register('autorizzato');
$_SESSION["autorizzato"] = 1;
$destinazione = "index.php";
} else {
$destinazione = "destroy.php";
}
echo '<script language=javascript>document.location.href="'.$destinazione.'"</script>';
} else {
?>

Rispondi quotando