Comunidad de diseño web y desarrollo en internet online

problema al mostrar datos con $_GET

Citar            
MensajeEscrito el 30 Abr 2010 10:13 pm
como puedo hacer para mostrar los datos de una bd de un perfil tengo aqui el codigo pero no se como mostrarlos en la otra pagina, se que es con el metodo $_GET pero no se como aplicarlo, haber si alguien me puede ayudar

Código PHP :

<?php
$conexion = mysql_connect("localhost", "xxxxxxx", "xxxxxxxx");
mysql_select_db("xxxxxxxxx", $conexion);

$queEmp = "SELECT * FROM registro_usuarios ORDER BY username";
$resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());
$totEmp = mysql_num_rows($resEmp);
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>mostrar datos</title>
<style type="text/css">
<!--
body {
   font-family: "Trebuchet MS", Tahoma, Verdana;
   font-size: 12px;
   font-weight: normal;
   color: #666666;
   text-decoration: none;
   padding: 20px;
}
h4 {
   color: #CC0000;
}
-->
</style>
</head>
<body>
<?php 
if ($totEmp> 0) {
   while ($rowEmp = mysql_fetch_assoc($resEmp)) {
      echo '<a href=perfil.php?username='.$rowEmp['username'].'>'.$rowEmp['username'].'</a><br />';   
   }
}
?>
</body>
</html>

Por cher1_7

55 de clabLevel



 

msie7
Citar            
MensajeEscrito el 01 May 2010 02:44 pm
Prueba lo siguiente:

Código PHP :

   while ($rowEmp = mysql_fetch_assoc($resEmp)) { ?>
      <a href="perfil.php?username=<?php echo $rowEmp['username']; ?>"><?php echo $rowEmp['username']; ?></a><br />
<?php   }

El problema parece ser que no estás encerrando correctamente entre comillas el parámetro href del tag <a>.

Por DriverOp

Claber

2510 de clabLevel



 

opera

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.