erro
o erro:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/zimm/public_html/admin/index.php on line 15Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/zimm/public_html/admin/index.php on line 29
o codigo-fonte:
> <html><head><title>+ ZiMM WEBSiTE :: Administração</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link href="css.css" rel="stylesheet" type="text/css"></head><body bgcolor="#333333" text="#333333" link="#333333" vlink="#333333" alink="#333333" leftmargin="0" topmargin="0"><?if($acao==logar){ $data = date('d/m'); $hora = date('H:i');include("conectar.php");$resultado=mysql_query("select * from 'usuarios' where usuario='$userid' and 'senha'=password('$pass')");$num_linhas=mysql_num_rows($resultado);if ($num_linhas=="0"){ echo ("<font face='Arial, Helvetica' size='-1' color='#ffffff'>"); echo ("Usuário ou senha inválidos.<BR>"); echo "<a href=java script:history.go(-1)>Voltar</a>";}else{ // caso contrario ele guarda na sessao os dados do usuario, o id e o nome do usuario $sql = "UPDATE usuarios SET logins = logins+1 WHERE usuario='$userid'"; $result = mysql_query($sql); $sql = "UPDATE usuarios SET hora = '$hora' WHERE usuario='$userid'"; $result = mysql_query($sql); $sql = "UPDATE usuarios SET data = '$data' WHERE usuario='$userid'"; $result = mysql_query($sql); while ($linha=mysql_fetch_array($resultado)){ //echo ("logado"); $id=$linha[0]; $nome=$linha[1]; $username=$linha[2]; $email=$linha[4]; $data=$linha[5]; $logins=$linha[6]; $hora=$linha[7]; session_start(); session_register('id','nome','username', 'email', 'data', 'logins', 'hora'); //echo ("logado"); header ("location: inicial.php"); }}} else {?><table width="100%" border="0" cellpadding="2" cellspacing="2" bgcolor="#333333"> <tr> <td><font color="#FFFFFF" size="4" face="Tahoma">+</font><font color="#CCCCCC" size="4" face="Tahoma">ZiMM<font color="#999999">WEBSiTE</font>: ADMINISTRAÇÃO <br> <font color="#CCCC00" size="1">.:: zimm.freesites.ws ___ 07/2004</font></font></td> </tr> <tr> <td height="36" valign="top"> <form name="form1" method="post" action="?acao=logar"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="24"><font color="#CCCC00" size="4" face="Tahoma">+<font color="#CCCCCC">LOGIN:</font></font></td> </tr> <tr> <td><input name="userid" type="text" class="botoes" id="userid" size="50"></td> </tr> <tr> <td><font color="#CCCC00" size="4" face="Tahoma">+<font color="#CCCCCC">SENHA: </font> </font></td> </tr> <tr> <td><input name="pass" type="password" class="botoes" id="pass" size="50"></td> </tr> <tr> <td height="50"><input name="go" type="submit" class="botoes1" id="go" value=" GO ! "> </td> </tr> </table> <font color="#CCCCCC" size="4" face="Tahoma"></font> </form></td> </tr></table></body></html><?}?>Discussão (12)
Carregando comentários...