![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
19/01/2012, 23:10
|
| | Fecha de Ingreso: julio-2010
Mensajes: 197
Antigüedad: 14 años, 7 meses Puntos: 32 | |
Respuesta: loguearme con PHP <?php
include('../soft/function/conexion.php'); $link = Conectarse();
$user = $_POST['usuario']; $pass = $_POST['password'];
$consulta = "SELECT * FROM m_usuarios WHERE Usuario = '$user'";
$inf = mysql_query($consulta); $res = mysql_fetch_array($inf);
if($res['Usuario']==''){header ("Location: ../index.php?errorusuario=si");}else{
if($res['Usuario']==$user && $res['Password']==$pass){header ("Location: ../soft/index.php");}
else{header ("Location: ../index.php?errorusuario=si");}}
session_start();
$_SESSION["Usuario"] = $user;
$_SESSION["Nivel"] = $res['Nivel'];
?> |