Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/06/2011, 09:47
emmonuel
 
Fecha de Ingreso: junio-2011
Mensajes: 6
Antigüedad: 12 años, 10 meses
Puntos: 0
Pregunta Buscar en la misma pagina, seleccionar elemento a modificar y enviarlo a otra pagina

Hola a todos, es la primera vez que escribo en este foro.

El problema que tengo es como estoy haciendo un pequeño proyecto familiar, estoy haciendo una bd de un consultorio, pero me surgio una duda que si puedo hacer una búsqueda en la misma pagina, me muestre el resultado y al momento de seleccionar cual paciente quiero modificar, se pasen todos los parámetros del que seleccione a otro php llamado "modifica.php", bueno, pongo el codigo para que me entiendan mejor

Codigo del archivo "modificar.php"

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Buscando...</title>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
Dame el nombre del paciente a buscar:
<input type="text" name="buscaPaciente" value=""/>
<br/>
<input type="submit" value="Buscar" />
<br/>
<table border="1" width="100%">
<thead>
<tr>
<th>Selector</th>
<th>Nombre Paciente</th>
<th>Edad</th>
<th>T.A.</th>
<th>Temp.</th>
<th>Peso</th>
<th>Indicacion 1</th>
<th>Indicacion 2</th>
<th>Indicacion 3</th>
<th>Medicamentos</th>
</tr>
</thead>
<?php
$paciente=isset ($_REQUEST["buscaPaciente"]) ? $_REQUEST["buscaPaciente"] : null;

if($paciente=='')
echo ("<br/>");
else{
$cnn=mysql_connect("localhost","root");
mysql_select_db("consultorio");
$sql="select * from recetasimpresion where nombre like '%$paciente%' ORDER BY nombre ASC;";

$reg=mysql_query($sql);
echo ("<br/>");
while($arreglo=mysql_fetch_array($reg)){
echo "<tr><td>";
?>
<input type="radio" name="id" value="<?php print $arreglo["id"];?>" />
<?php
echo "</td><td>";
echo $arreglo["nombre"];
echo "</td><td>";
echo ("<center>");
echo $arreglo["edad"];echo('&nbsp; años');
echo ("</center>");
echo"</td><td>";
echo ("<center>");
echo $arreglo["ta"];
echo ("</center>");
echo "</td><td>";
echo ("<center>");
echo $arreglo["temperatura"];echo('&nbsp;°C');
echo ("</center>");
echo "</td><td>";
echo ("<center>");
echo $arreglo["peso"];echo('&nbsp; Kg.');
echo ("</center>");
echo "</td><td>";
echo $arreglo["indicacion1"];echo('&nbsp;');
echo "</td><td>";
echo $arreglo["indicacion2"];echo('&nbsp;');
echo "</td><td>";
echo $arreglo["indicacion3"];echo('&nbsp;');
echo "</td><td>";
echo $arreglo["medicamento"];
echo "</td></tr>";
}
mysql_close($cnn);
}
?>
<tr><td colspan="10" align="center">
<input value="Modificar" name="submit" type="button" onclick="window.location.href = 'modifica.php';" />
</td><tr>
</table>
</form>
</body>
</html>

Habra manera de hacer eso, o es poner un Form dentro de otro form