Ver Mensaje Individual
  #15 (permalink)  
Antiguo 12/05/2010, 03:07
Avatar de Flow89
Flow89
 
Fecha de Ingreso: abril-2010
Ubicación: Valladolid
Mensajes: 346
Antigüedad: 14 años
Puntos: 1
Respuesta: Sistema de Login :S

Ahora si funciona, el puto Internet Explorer me da un asco!! QUE LA GENTE DEJE DE USARLO!!! ES UNA MIERDA!! ajjaja

te paso codigos a ver.. pero ya te digo en mozilla tira perfecto y en IE toca los webos...

ingresar.php
Código PHP:
<html>
<head>
<title>JuventudMDC - Panel de Administraci&oacute;n</title>
<link href="../css/general.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php
   
include("conex.php");
function 
quitar($mensaje)
   {
   
$mensaje str_replace("<","&lt;",$mensaje);
   
$mensaje str_replace(">","&gt;",$mensaje);
   
$mensaje str_replace("\'","'",$mensaje);
   
$mensaje str_replace('\"',"&quot;",$mensaje);
  
$mensaje str_replace("\\\\","\\",$mensaje);
  return 
$mensaje;
   }
  
  if(
trim($HTTP_POST_VARS["nick"]) != "" && trim($HTTP_POST_VARS["password"]) != "")
  {
  
$nickN quitar($HTTP_POST_VARS["nick"]);
  
$passN quitar($HTTP_POST_VARS["password"]);
  
$result mysql_query("SELECT password FROM usuarios WHERE nick='$nickN'");
  if(
$row mysql_fetch_array($result))
   {
  if(
$row["password"] == $passN)
  {
  
//La cookie dura 1 hora
  
setcookie("usNick",$nickN,time()+36000);
  
setcookie("usPass",$passN,time()+36000);
  echo 
"<table style=\"height:100%;width:100%;\" border=\"0\"><tr><td class=\"estilo34\"><div align=\"center\">Logueado correctamente, ahora sera dirigido a el panel de administración automaticamente.</div></td></tr></table>";
  echo 
"<META HTTP-EQUIV=\"refresh\" CONTENT=\"2; url=administracion.php\">";
  }
  else
  {
  echo 
"<META HTTP-EQUIV=\"refresh\" CONTENT=\"2; url=../panel.php\">";
  echo 
"<table style=\"height:100%;width:100%;\"border=\"0\"><tr><td class=\"estilo34\"><div align=\"center\"><br>Contraseña incorrecta. <br> Seras redireccionado automaticamente.</div></td></tr></table>";
  }
  }
  else
  {
  echo 
"<META HTTP-EQUIV=\"refresh\" CONTENT=\"2; url=../panel.php\">";
  echo 
"<table style=\"height:100%;width:100%;\"border=\"0\"><tr><td class=\"estilo34\"><div align=\"center\"><br>Ese Usuario no existe en la base de datos. <br> Seras redireccionado automaticamente.</div></td></tr></table>";
  }
  
mysql_free_result($result);
  }
  else
  {
  echo 
"<META HTTP-EQUIV=\"refresh\" CONTENT=\"2; url=../panel.php\">";
  echo 
"<table style=\"height:100%;width:100%;\"border=\"0\"><tr><td class=\"estilo34\"><div align=\"center\"><br>Debe especificar un nick y password. <br> Seras redireccionado automaticamente.</div></td></tr></table>";
  }
  
mysql_close();  
  
?> 
</body>
</html>

login.php
Código PHP:
<?php
   $loginCorrecto 
false;
   
$idUsuarioL;
   
$nickUsuarioL;
   
$emailUsuarioL;
   
$nombreUsuarioL;
$result mysql_query("SELECT * FROM usuarios WHERE nick='".
$HTTP_COOKIE_VARS["usNick"]."' AND password='".$HTTP_COOKIE_VARS["usPass"]."'");
$rows mysql_fetch_array($result);
if(
mysql_num_rows($result) == 1){
    
$loginCorrecto true;
} else {
    
$loginCorrecto false;
}
mysql_free_result($result);
  
?>