Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/11/2013, 11:35
Inestal
 
Fecha de Ingreso: octubre-2013
Mensajes: 5
Antigüedad: 10 años, 6 meses
Puntos: 0
Mostrar registros

Hola a todos,
Estoy haciendo una pequeña pagina web.
El problema que tengo es que cuando voy a mi perfil solo me muestra los datos usuario y pass,los otros datos como nombre ,apellido y mail muestra lo siguiente:
<br /><b>Notice</b>: Undefined index: mail in <b>F:\xampp\htdocs\cuenta.php</b> on line <b>90</b><br />
Las lineas que me dan esos probleas estan metidas entre color rojo.

Este es el archivo cuenta.php
Código PHP:
<?php
session_start
();
include
"config.php";

?>
Código HTML:
<!DOCTYPE HTML>
<html> 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
</head>

<body>

      
<?php  

$id = @$_GET["id"]; 

$ssql = "select * from usuarios where id=" . $id; 
$rs_libros = mysql_query($ssql); 
while(@$fila = mysql_fetch_array($rs_libros)) { 
echo "Usuario: "; 
echo $fila["usuario"] . " | "; 
echo "Password: "; 
echo $fila["password"] . " | "; 
echo "Rango: "; 
echo $fila["rango"] . " | "; 
echo "Nombre: "; 
echo $fila["nombre"] . " | "; 
echo "Apellido: "; 
echo $fila["apellido"] . " | "; 
echo "Mail: "; 
echo $fila["mail"] . "<br /><br />"; 
$_SESSION["id"]=$id; 
$_SESSION["usuario"]=$fila["usuario"]; 
$_SESSION["password"]=$fila["password"]; 
$_SESSION["rango"]=$fila["rango"]; 
$_SESSION["nombre"]=$fila["nombre"];
$_SESSION["apellido"]=$fila["apellido"];
$_SESSION["mail"]=$fila["mail"];
} 
?> 
      
 
    

 <table>
   <tr> <input type="hidden" name="id" value="<?php echo  $_SESSION['id'];?>"></tr>

        <tr>
            <td>Usuario:</td>
            <td><input type="text" name="usuario" value="<?php echo  $_SESSION['usuario'];?>"  /></td>
        </tr>
        <tr>
            <td>Password:</td>
            <td><input type="password" name="password" value="<?php echo  $_SESSION['password'];?>" /></td>
        </tr>
        <tr> <input type="hidden" name="rango" value="<?php echo  $_SESSION['rango'];?>"></tr>
        <tr>
            <td>Nombre:</td>
            <td><input type="text" name="nombre"[COLOR="red"] value="<?php echo  $_SESSION['nombre'];?>"[/COLOR] /></td>
        </tr>
        <tr>
            <td>Apellidos:</td>
            <td><input type="text" name="apellido"  [COLOR="red"]value="<?php echo  $_SESSION['apellido'];?>"[/COLOR]/></td>
        </tr>
        <tr>
            <td>Mail:</td>
            <td><input type="text" name="mail" [COLOR="red"]value="<?php echo  $_SESSION['mail'];?>"[/COLOR] /></td>
        </tr>

        </table>


 
</body>
</html> 
Este es el archivo actualizar.php
Código PHP:
<?php
session_start
();
include
"config.php";

?>
<?php  

$consulta 
"select id, usuario, password, rango, nombre, apellido,mail from usuarios"
$rs mysql_query($consulta); 
while(
$fila mysql_fetch_array($rs)) { 
echo
'<a href="cuenta.php?id=' $fila['id'] . '">Editar</a> '
echo 
$fila["usuario"] . " | "
echo 
$fila["password"] . " | "
echo 
$fila["rango"] . " | "
echo 
$fila["nombre"] . " | "
echo 
$fila["apellido"] . " | "
echo 
$fila["mail"] . "<br />"

?>

Última edición por Inestal; 28/11/2013 a las 11:45