![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
20/06/2009, 15:13
|
![Avatar de gjx2](http://static.forosdelweb.com/customavatars/avatar253651_4.gif) | | | Fecha de Ingreso: agosto-2008 Ubicación: R.D
Mensajes: 1.153
Antigüedad: 16 años, 6 meses Puntos: 139 | |
Respuesta: ayuda! modificar archivo para listar usuarios con php Usa esto como archivo de userPerfil.php
Código:
<link rel="StyleSheet" href="estilo-tabla-usuarios.css" type="text/css"></head>
<div id="tabla-usuarios">
<?php
$conexion=mysql_connect("localhost","user","pass") or
die("Problemas en la conexion");
mysql_select_db("db_name",$conexion) or
die("Problemas en la selección de la base de datos");
$registros=mysql_query("select username,edad,pais,paginaweb from usuarios where username='$_GET[id]'",$conexion) or
die("Problemas en el select:".mysql_error());
echo '<br><a href="index.php?modulo=privado">volver al index</a>';
echo '<table border="1">';
echo '<tr><td>Nombre de usuario</td><td>edad</td><td>pais</td><td>pagina web</td></tr>';
while ($reg=mysql_fetch_array($registros))
{
echo '<tr>';
echo '<td><b>'.$reg['username'].'</b></td>';
echo '<td><b>'.$reg['edad'].'</b></td>';
echo '<td><b>'.$reg['pais'].'</b></td>';
echo '<td><b><a href='.$reg['paginaweb'].'>visitar</a></b></td>';
echo '</tr>';
}
echo '</table>';
mysql_close($conexion);
?>
</div>
|