Login variable is empty but password is OK. Why? (newbie question)

From: Date: Wed, 21 Jan 2004 20:55:33 +0000
Subject: Login variable is empty but password is OK. Why? (newbie question)
Groups: php.general 
Request: Send a blank email to php-general+get-175338@lists.php.net to get a copy of this message
My code is simply to login. I have two files: login.html (form) and login.php to validate. I don´t understand why php capture only password )I call it senha) and take a blank username (I call it nome). Any idea? #Code - login.html <form method="POST" action="login.php"> ... <input type="text" name="nome"> <input type="password" name="senha"> <input type="submit" name="Submit" value="Enviar"> <input type="reset" name="Submit2" value="Limpar"> ... #Code: login.php <? include('conecta.inc.php') ; $cod=md5($senha); $sql = "SELECT * FROM usuario where nome='$nome' AND senha='$cod'""; $tarefa=mysql_query($sql); $num=mysql_numrows($tarefa); $i=0; if ($num < 1) { header("Location:login.html"); } else { while ($num > $i) { $nome = mysql_result($tarefa,$i,"nome"); $tipo = mysql_result($tarefa,$i,"tipo"); $i++; } setcookie("nome", "$nome"); setcookie("tipo", "$tipo"); header("Location:index.php"); } ?>

« previous php.general (#175338) next »