Cita:
Iniciado por andresdzphp
este es mi codigo original
Código PHP:
<?php
error_reporting ( E_ERROR );
session_start();
if($_SESSION["var_session"]==""){
header("Location:http://localhost/agendas/archivos/index.php");
}
else
$varse=$_SESSION["var_session"];
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("agenda", $con);
if($name!==""){
$result = mysql_query("SELECT * FROM usuarios WHERE Email='$varse'");
$Id_Usuario= mysql_fetch_array($result);
$result2 = mysql_query("SELECT * FROM contactos WHERE Id_Usuario='$Id_Usuario[Id_Usuario]'");
$Id_Usuario2= mysql_fetch_array($result2);
$numero = mysql_num_rows($result2); // obtenemos el número de filas
}
?>
<!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>Documento sin título</title>
<link href="../css/estilos_welcome.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
color: #FFFFFF;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #FFFFFF;
}
a:hover {
text-decoration: none;
color: #CCCCCC;
}
a:active {
text-decoration: none;
color: #CCCCCC;
}
.Estilo1 {color: #000000}
-->
</style></head>
<body>
<div id="container">
<div id="head">
<div id="light"></div>
<div id="user">Bienvenido: <?php echo $varse; ?></div>
<div id="light2"></div>
<div id="cerrar"><a href="sesion/terminar sesion.php">Cerrar</a></div>
</div>
<div id="profile">
<div id="profile_1">
<div id="profile_head">Perfil</div>
<div id="p_mod">Modificar Perfil</div>
</div>
<div id="informacion">
<div id="infor_head">informacion</div>
<div class="Estilo1" id="info_nombre"><strong>Nombre:</strong> <?php printf($Id_Usuario[Name]); ?></div>
<div id="info_apellido"><strong>Apellido:</strong> <?php printf($Id_Usuario[Lastname]); ?></div>
<div id="info_tel"><strong>Telefono:</strong> <?php printf($Id_Usuario[Phone]); ?></div>
<div id="info_email"><strong>Email:</strong> <?php printf($Id_Usuario[Email]); ?></div>
</div>
<div id="No_contactos">
<div id="No_head">Contactos</div>
<div id="add_contacto">Agregar Contactos</div>
<div id="Ncontactos"><strong>No. de Contactos:</strong> <?php echo "[$numero]"; ?></div>
</div>
</div>
<div id="contactos">
<div id="head_tContactos">Lista de contactos</div>
<div id="tabla">
<table width="591" id="ta">
<tr>
<td colspan="5"><div align="center"><strong>Contactos</strong></div></td>
</tr>
<tr>
<td><div align="center"><em><strong>Nombre</strong></em></div></td>
<td><div align="center"><em><strong>Email</strong></em></div></td>
<td><div align="center"><em><strong>Modificar</strong></em></div></td>
<td><div align="center"><em><strong>Eliminar</strong></em></div></td>
<td><div align="center"><em><strong>Mas Informacion...</strong></em></div></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</div>
</div>
</div>
</body>
</html>