Ver Mensaje Individual
  #5 (permalink)  
Antiguo 20/06/2011, 11:21
emmonuel
 
Fecha de Ingreso: junio-2011
Mensajes: 6
Antigüedad: 12 años, 9 meses
Puntos: 0
Respuesta: Buscar en la misma pagina, seleccionar elemento a modificar y enviarlo a o

Sigo recibiendo errores y no recibo los datos :S

Pongo el otro código en donde recibo la posición del id y tiene que rellenar los datos para que se entienda un poco mejor mi problema

Codigo de "modifica.php"
<!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>Receta</title>
<script>
function caps(element){
element.value = element.value.toUpperCase();
}
</script>


<link rel="stylesheet" href="css\receta.css">
</head>
<body>
<?php
// put your code here
$id=isset($_POST["id"]) ? $_POST["id"] : null;
$cnn=mysql_connect("localhost", "root");
mysql_select_db("consultorio");

$sql="select * from recetasimpresion where id=".$id;

$result=mysql_query($sql);
$arreglo=mysql_fetch_array($result);
mysql_close($cnn);
?>
<form action="cambia.php" method="post">
<table width="700" border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="colortitulo">DATOS GENERALES DEL PACIENTE</td>
</tr>
</table>
<table width="700" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="8%" height="24" valign="bottom" id="fuentetexto">Nombre:</td>
<td colspan="7" valign="top"><input name="nombrePaciente" type="text" id="nombrePaciente" size="100" maxlength="80" onkeyup="caps(this)" value="<?php print $arreglo["nombre"];?>"/></td>
</tr>
<tr>
<td height="49" id="fuentetexto">Edad:</td>
<td width="15%"><input name="edadPaciente" type="text" id="edadPaciente" size="3" maxlength="3" value="<?php print $arreglo["edad"];?>"/>
<font id="fuentetexto">años </font></td>
<td width="4%" align="right" id="fuentetexto">T.A.:</td>
<td width="9%"><input name="TA" type="text" id="TA" size="10" maxlength="10" value="<?php print $arreglo["ta"];?>" /></td>
<td width="12%" align="right" id="fuentetexto">Temp.:</td>
<td width="11%"><input name="tempPaciente" type="text" id="tempPaciente" size="3" maxlength="3" value="<?php print $arreglo["temperatura"];?>"/>
<font id="fuentetexto">°C </font></td>
<td width="26%" align="right" id="fuentetexto">Peso:</td>
<td width="15%"><input name="pesoPaciente" type="text" id="pesoPaciente" size="4" maxlength="4" value="<?php print $arreglo["peso"];?>"/>
<font id="fuentetexto">Kilos</font></td>
</tr>
<tr>
<td colspan="8" id="fuentetexto">Medicamentos:</td>
</tr>
<tr>
<td height="225" colspan="8"><center><textarea name="medicina" cols="80" rows="13" id="medicina" onkeyup="caps(this)" value="<?php print $arreglo["medicamento"];?>"></textarea></center></td>
</tr>
</table>
<table width="700" border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="colortitulo" class="fuentetexto">INDICACIONES</td>
</tr>
</table>
<table width="700" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="6%" height="28" align="center" id="fuentetexto">1.-</td>
<td width="94%"><label for="indicacion1"></label>
<input name="indicacion1" type="text" id="indicacion1" size="100" onkeyup="caps(this)" value="<?php print $arreglo["indicacion1"];?>"/></td>
</tr>
<tr>
<td height="31" align="center" id="fuentetexto">2.-</td>
<td><input name="indicacion2" type="text" id="indicacion2" size="100" onkeyup="caps(this)" value="<?php print $arreglo["indicacion2"];?>"/></td>
</tr>
<tr>
<td height="28" align="center" id="fuentetexto">3.-</td>
<td><input name="indicacion3" type="text" id="indicacion3" size="100" onkeyup="caps(this)" value="<?php print $arreglo["indicacion3"];?>"/></td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2"><center><input id="botontexto"type="submit" value="Generar Receta para Imprimir" /></center></td>
<input type="hidden" name="id"
value="<?php print $id?>"/>
</tr>
</table>
</form>
</body>
</html>