Welcome to Familiar
This is Familiar , a free, fully standards-compliant CSS template designed by Free CSS Templates, released for free under the Creative Commons Attribution 2.5 license. You're free to use this template for anything as long as you link back to my site. Enjoy :)
Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum ipsum. Proin imperdiet est. Phasellus dapibus semper urna. Pellentesque ornare, orci in felis.
luisquintana2010
data de
MySQL: CREATE TABLE usuarios( `id` INT( 4 ) NOT NULL AUTO_INCREMENT , `nombre` TEXT, `apaterno` TEXT, `amaterno` TEXT, `login` VARCHAR( 40 ) NOT NULL , `password` VARCHAR( 80 ) NOT NULL , `email` TEXT, UNIQUE KEY ( id ) ); } /* Y cerramos el else */ ?> <?php session_start(); // modificacion de codigo Xombra (www.xombra.com) 21/03/2009 para sectorweb.net include("config.php"); $login = htmlspecialchars(trim($_POST['login'])); $pass = sha1(md5(trim($_POST['pass']))); // encriptamos en MD5 para despues comprar (Modificado) // $query="SELECT * FROM usuarios WHERE login='$login'"; Antes $link=mysql_connect($server,$dbuser,$dbpass); $query = sprintf("SELECT usuarios.login, usuarios.nombre, usuarios.apaterno, usuarios.amaterno, usuarios.email FROM usuarios WHERE usuarios.login='%s' && usuarios.password = '%s'", // Ahora mysql_real_escape_string($login),mysql_real_escape_string($pass)); $result=mysql_db_query($database,$query,$link); // if(mysql_num_rows($result)==0){ // antes if(mysql_num_rows($result)){ // nos devuelve 1 si encontro el usuario y el password $array=mysql_fetch_array($result); // if($array["password"]==crypt($pass,"semilla") ){ // Antes /* Comprobamos que el password encriptado en la BD coincide con el password que nos han dado al encriptarlo. Recuerda usar semilla para encriptar los dos passwords. */ $_SESSION["login"]=$array["login"]; $_SESSION["nombre"]=$array["nombre"]; $_SESSION["apaterno"]=$array["apaterno"]; $_SESSION["amaterno"]=$array["amaterno"]; $_SESSION["email"]=$array["email"]; // Agrgado Nuevo header("Location:user.php"); } else { echo "Login o Password Incorrectos"); // Ahora } ?> lt;? session_start(); if(!isset($_SESSION)){ header("location:login.php"); } else { echo ""; echo "SectorWeb.net
"; echo "Bienvenido al Area de usurios: "; echo $_SESSION["nombre"]." ".$_SESSION["apaterno"]." ".$_SESSION["amaterno"]." "; echo " Has entrado con el nick: "; echo $_SESSION["login"]; echo " Para cerrar la sesión, pulsa: Aqui"; echo ""; } ?> Nombre: Apellido Paterno: Apellido Materno: E-mail:Welcome to Familiar
This is Familiar , a free, fully standards-compliant CSS template designed by Free CSS Templates, released for free under the Creative Commons Attribution 2.5 license. You're free to use this template for anything as long as you link back to my site. Enjoy :)
Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum ipsum. Proin imperdiet est. Phasellus dapibus semper urna. Pellentesque ornare, orci in felis.
Lorem ipsum sed aliquam
Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec consectetuer. Donec ipsum. Proin imperdiet est. Phasellus dapibus semper urna. Pellentesque ornare, orci in consectetuer hendrerit, urna elit eleifend nunc, ut consectetuer nisl felis ac diam. Etiam non felis. Donec ut ante. In id eros.
Lorem ipsum sed aliquam
Mauris vitae nisl nec metus placerat consectetuer. Donec ipsum. Proin imperdiet est. Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer. Donec ipsum. Proin imperdiet est. Phasellus dapibus semper urna. Pellentesque ornare, orci in consectetuer hendrerit, urna elit eleifend nunc, ut consectetuer nisl felis ac diam.