Ver Mensaje Individual
  #2 (permalink)  
Antiguo 03/01/2012, 04:12
Avatar de interjsr
interjsr
 
Fecha de Ingreso: octubre-2011
Ubicación: Madrid
Mensajes: 81
Antigüedad: 13 años, 4 meses
Puntos: 2
Respuesta: Formulario y PHP

ok, me respondo yo solo :)

El formulario con la cabecera
<form method="post" action="Valida.php">

Valida .php
<?php
import_request_variables("pg","f_");

$f_Usuario = $_POST['Usuario'];
$f_Clave = $_POST['Clave'];

if(empty($f_Usuario)||empty($f_Clave))
header("Location: apli3.html");
else{
$conn = mysql_connect("localhost","root","vertrigo");
mysql_select_db("Duendes",$conn);


$ssql = "SELECT * FROM Usuarios WHERE Usuario='$f_Usuario' and Clave='$f_Clave'";

$rs = mysql_query($ssql,$conn);

if (mysql_num_rows($rs)!=0){
session_start();
session_register("autentificado");
$autentificado = "SI";
header ("Location: aplicacion.php");
}else {
header("Location: apli2.php");
}
mysql_free_result($rs);
mysql_close($conn);
}
?>