![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
24/03/2011, 10:20
|
| | Fecha de Ingreso: marzo-2011
Mensajes: 81
Antigüedad: 13 años, 10 meses Puntos: 0 | |
Respuesta: Pasar variable id por URL <?php
require("conexion.php");
$dato = getParam($_GET["dato"], "");
$id =$_GET["id"];
$query = "SELECT * FROM empresa WHERE id=$id";
$queEmp = mysql_query($query,$conexion);
$rsEmp = mysql_fetch_assoc($queEmp);
$total = mysql_num_rows($queEmp);
?>
<!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>PHP con MySQL: Consultar datos en MySQL</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
</table>
<p> </p></td>
</tr>
</table>
<div>
<table width="200" border="0" align="center">
<tr>
<td><h3>Buscador de Empresas</h3>
<form id="frbuscar" name="frbuscar" method="get" action="bus_rif3.php">
<input name="dato" type="text" id="dato" size="20" value="<?php echo $dato; ?>" />
<input type="submit" id="btbuscar" value="Buscar"/>
</form>
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<th>Nombre</th>
<th>Direccion</th>
<th>Telefono</th>
</tr>
<?php while ($id = mysql_fetch_assoc($queEmp))
{ ?>
<tr>
<td>
</form>
<input type="text" name="nombre " id="nombre "size="20" value="<?php echo $vc['nombre']; ?>" />
</td>
<td> <input type="text" name="direccion " id="direccion "size="20" value="<?php echo $vc['direccion']; ?>" /> </td>
<td> <input type="text" name="telefono" id="telefono"size="20" value="<?php echo $vc['telefono']; ?>" /> </td>
<td> </td>
<input type="hidden" name="id" id="id" size="20" value="<?php echo $id["id"]; ?>" />
<td> </td>
</tr>
<?php } ?>
</table>
</td>
</tr>
</table>
</div>
<h3> </h3>
<h3> </h3>
<p> </p>
</body>
</html> |