He intentado de varias maneras arreglarlo pero no funciona, les dejo los codigos del formilario y del script
index.php (formulario)
Código PHP:
ver.phpVer original
<?php include('config.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <meta name="viewport" content="width=device-width; initial-scale = 1.0; maximum-scale=1.0; user-scalable=no" /> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Blog de Skar <?php echo $file; ?></title> <style type="text/css"> body,td,th { font-family: Tahoma, Geneva, sans-serif; color: #F00; } body { background-color: #000; } </style> </head> <body> <div align="center"> <?php echo "Bienvenido a mi sitio has ingresado como ".$_SESSION['s_user'].", gracias por la visita!"; }else{ ?> <form action="ver.php" method="POST"><br> Nombre:<input type="text" id="user" name="user"> <br> Contraseña:<input type="password" id="pass" name="pass"> <br> <input type="submit" id="enviar" name="enviar" value="Enviar"> <?php } ?> </form> </div> </body> </html>
Código PHP:
Ver original
<?php include('config.php'); sion_destroy(); }else{ $user= $_POST['user']; } $query="SELECT user FROM users WHERE user='$user'"; if($numrow != 0){ if($numpass != 0){ if(!$row['pass'] == $pass){ echo "La contraseña ingresada es incorrecta, vuelve a iniciar sesion, "; echo "<a href='index.php'>aqui</a>"; }else{ //echo "Bienvenido admin: ".$row['user']; $_SESSION['s_user']=$row['user']; } }else{ echo "no se encuentra el usuario ingresado\n"; echo "por favor verifique los datos e ingrese nuevamente, <a href='index.php'>Inicio</a>"; } } ?>
Atento a su ayuda gracias