Tengo este script que lee la base de datos creada por otra web, lo que quiero hacer que que al logear y diga correctamente logeado, lo redirecciine al perfil osea perfil.php y capture el usuario y la contraseña y le diga:
en perfil.php
Usuario: pepito
Contraseña: contraseñadepepito
este es el codigo:
login.php
Código PHP:
Ver original
<?php include("cfg/mysql.php"); $username = $_POST['username']; $password = $_POST['password']; $sesion_login = true; $con = Conectarse(); $query = "SELECT * FROM jugadores WHERE usuario ='".$username."' AND contra = '".$password."'"; try{ //echo $result; echo "Correctamente Logeado!"; }else echo "Usuario o password erroneos."; }catch(Exception $error){} ?>
index.php
Código PHP:
Ver original
<?php include("cfg/mysql.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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Ingreso - MundoExtremo</title> <link href="cfg/estilo.css" rel="stylesheet" type="text/css" /> <link rel="shortcut icon" href="img/favicon.jpg"> </head> <style> body { background-image:url(img/fondo.png); background-position:center; background-attachment:fixed; }</style> <body><div id="cuerpo_ingreso"> <div id="contenido_ingreso"> <br /> <span class="titulo">INGRESA TUS DATOS:</span><br /> <br /> <form action="login.php" method="post"> <b>Nombre de Usuario:</b><br /> <input name="username" type="text" value="usuario" size="30" maxlength="20" class="campo_reposo_ingreso" onfocus="if (this.value == 'Nombre de usuario') { this.value = '' } this.className='campo_sobre_ingreso'" onblur="if (this.value == '') { this.value = 'Nombre de usuario' } this.className='campo_reposo_ingreso'" /> <br /><br /> <b>Contraseña:</b><br /> <input name="password" type="password" value="contraseña" size="30" maxlength="20" class="campo_reposo_ingreso" onfocus="if (this.value == 'Contraseña') { this.value = '' } this.className='campo_sobre_ingreso'" onblur="if (this.value == '') { this.value = 'Contraseña' } this.className='campo_reposo_ingreso'" /> <br /><br /> <input name="ingresar" type="submit" value="INGRESAR" class="botonf_reposo_ingreso" onmouseover="this.className= 'botonf_sobre_ingreso'" onmouseout="this.className='botonf_reposo_ingreso'" /> </form> <br /> <span class="footer_ingreso">MundoExtremo © Desarollado por CeKiT</span> </div> </div> </body> </html>