SoloCodigo
		Programación Web y Scripting => PHP => Mensaje iniciado por: reydenvosivo en Viernes 10 de Agosto de 2007, 01:23
		
			
			- 
				Hola colegas. Mi problema es con un formulario en un codigo php. Resulta que no me envia datos a otro archivo. Los archivos son buscarcliente.php y actualizar.php.
 
 CODIGOS:
 //actualizarcliente.php
 
 <form name="form1" method="post" action="actualizarcliente.php">
 
 <html>
 
 <head>
 
 <title>Busqueda Cliente</title>
 
 
 
 <link type="text/css" rel="stylesheet" href="estilo.css" media="screen, projection">
 
 
 
 
 
 <style type="text/css">
 
 <!--
 
 .Estilo1 {color: #FFFFFF}
 
 .Estilo2 {color: #FFFFFF; font-weight: bold; }
 
 -->
 
 </style>
 
 </head>
 
 <body style="background:#3d8bd6 url(imagenes/img/azuldegrade.jpg) top left repeat-x">
 
 <div align="center">
 
 
 
 <div align="center"><script type="text/javascript" language="JavaScript1.2" src="manuadmin.js"></script></div>
 
 <h2 style="text-align:center;color:#fff;">Búsqueda Cliente </h2>
 
 
 
 <p><table width="94%" height="117%" border="1" align="center" valign="middle" cellspacing="0" bordercolor="#0000FF" id="0"  >
 
 <tr>
 
 <td width="95%" height="90%" align="center" valign="middle" bordercolor="#0000FF">
 
 
 
 <?php
 
 
 $coneccion = include "conexion.php";
 
 
 
 $result=mysql_query("SELECT * FROM cliente ", $conexion);
 
 if (!$result) {
 
 echo "Ha ocurrido un error.\n";
 
 exit;
 
 }
 
 
 while($row=mysql_fetch_row($result)){
 
 if ($row[2] == $_REQUEST[cod]){
 
 
 
 $_REQUEST[nombre]=$row[0];
 
 $_REQUEST[apellido]=$row[1];
 
 $_REQUEST[rut]=$row[2];
 $_REQUEST[fono]=$row[3];
 
 $_REQUEST[direccion]=$row[4];
 $_REQUEST[ciudad]=$row[5];
 
 
 
 
 
 
 
 
 }
 }
 if (!$_REQUEST[rut]) { echo "No se ecnuentra rut: '$_REQUEST[cod]'"; /*hacer un Volver*/}
 
 ?>
 <br>
 
 
 
 
 
 <table width="90%" height="60%" border="0" align="center" valign="middle" cellspacing="0" bordercolor="#0000FF" id="0">
 
 <tr>
 
 <td width="18%" height="60%" rowspan="13" align="center" valign="top" bordercolor="#0000FF">
 
 </td>
 
 <td height="5%" colspan="3" align="center" valign="middle" border="1">
 
 <div align="center"></div></td>
 
 <td width="27%" height="60%" rowspan="95" align="center" valign="bottom" bordercolor="#0000FF"><div align="center">
 
 </div></td>
 
 </tr>
 
 <tr>
 
 <td height="5%" align="center" valign="middle" border="1" cellspacing="0"><div align="left">
 
 <p><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif"><strong>Rut Cliente </strong></font></p>
 
 </div></td>
 
 <td height="5%" align="center" valign="middle"><div align="center" class="Estilo1">:</div></td>
 
 <td height="5%" align="left" valign="middle"><input type="text" name="rut" size="20" maxlength="50" value= <?php echo "\"".$_REQUEST[rut]."\""; ?>></td>
 
 </tr>
 
 <tr>
 
 <td width="30%" height="5%" align="center" valign="middle" bordercolor="#0000FF">
 
 <div align="left"><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif"><strong>Nombre</strong></font></div></td>
 
 <td width="8%" height="5%" align="center" valign="middle" bordercolor="#0000FF" >
 
 <div align="center" class="Estilo1">:</div></td>
 
 <td width="17%" height="5%" align="center" valign="middle">
 
 <div align="left">
 
 <input type="text" name="nombre" size="20" maxlength="50" value= <?php echo "\"".$_REQUEST[nombre]."\""; ?>>
 
 </div></td>
 
 </tr>
 
 <tr>
 
 <td width="30%" height="5%" align="center" valign="middle" bordercolor="#0000FF">
 
 <div align="left"><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif"><strong>Apellido</strong></font></div></td>
 
 <td width="8%" height="5%" align="center" valign="middle" bordercolor="#0000FF">
 
 <div align="center" class="Estilo1">:</div></td>
 
 <td width="17%" height="5%" align="left" valign="middle" bordercolor="#0000FF" >
 
 <input type="text" name="apellido" size="20" maxlength="50" value= <?php echo "\"".$_REQUEST[apellido]."\""; ?>></td>
 
 </tr>
 
 <tr>
 
 <td width="30%" height="5%" align="center" valign="middle" bordercolor="#0000FF">
 
 <div align="left"><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif"><strong>Ciudad</strong></font></div></td>
 
 <td width="8%" height="5%" align="center" valign="middle" bordercolor="#0000FF" >
 
 <div align="center" class="Estilo1">:</div></td>
 
 <td width="17%" height="5%" align="center" valign="middle">
 
 <div align="left">
 
 <input type="text" name="ciudad" size="20" maxlength="50" value= <?php echo "\"".$_REQUEST[ciudad]."\""; ?>>
 
 </div></td>
 
 </tr>
 
 
 <tr>
 
 <td width="30%" height="5%" align="center" valign="middle" bordercolor="#0000FF">
 
 <div align="left"><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif"><strong>Direccion</strong></font></div></td>
 
 <td width="8%" height="5%" align="center" valign="middle" bordercolor="#0000FF" >
 
 <div align="center" class="Estilo1">:</div></td>
 
 <td width="17%" height="5%" align="center" valign="middle">
 
 <div align="left">
 
 <input type="text" name="dir" size="20" maxlength="50" value= <?php echo "\"".$_REQUEST[direccion]."\""; ?>>
 
 </div></td>
 
 </tr>
 
 <tr>
 
 <td width="30%" height="5%" align="center" valign="middle" bordercolor="#0000FF">
 
 <div align="left"><font color="#FFFFFF" size="3" face="Arial, Helvetica, sans-serif"><strong>Telefono</strong></font></div></td>
 
 <td width="8%" height="5%" align="center" valign="middle" bordercolor="#0000FF" >
 
 <div align="center" class="Estilo1">:</div></td>
 
 <td width="17%" height="5%" align="center" valign="middle">
 
 <div align="left">
 
 <input type="text" name="telefono" size="20" maxlength="50" value= <?php echo "\"".$_REQUEST[fono]."\""; ?>>
 
 </div></td>
 
 </tr>
 
 
 </table>
 
 
 
 <table width="90%" height="9%" border="0" align="center" valign="middle" cellspacing="0" bordercolor="#0000FF" id="0">
 
 <tr>
 
 <td width="45%" height="9%" valign="middle" align="right" bordercolor="#0000FF"><input type="submit" name="Submit" value="Actualizar"></td>
 
 <td width="45%" height="9%" align="left" valign="middle" bordercolor="#0000FF" > </td>
 
 </tr>
 
 </table>
 
 <div align="right"> </div>
 
 
 
 
 
 <p></p>
 
 
 
 
 
 
 
 </td>
 
 </tr>
 
 </table>
 
 
 
 
 
 </body>
 
 </html>
 
 
 
 </form>
 
 
 
 
 
 //COIGO ACTUALIZAR.PHP
 
 
 
 <html>
 
 
 
 
 
 <body style="background:#3d8bd6 url(imagenes/img/azuldegrade.jpg) top left repeat-x">
 
 
 
 <h2 style="text-align:center;color:#fff;"> </h2>
 
 
 
 <h2 style="text-align:center;color:#fff;">
 
 
 <?php
 
 $coneccion = include "conexion.php";
 if(!$coneccion) {echo "No me pude conectar";}
 
 
 
 echo $_REQUEST[rut]; //AQUI NO ME IMPRIME EL RUT. DEL FORMULARIO ANTERIOR
 
 
 
 echo $nombre; echo "funciona mierda"; echo $dir; echo $_REQUEST[dir]; echo" uff";
 $result=mysql_query("UPDATE cliente SET nombre=$nombre,
 apellido=$apellido",$conexion);
 
 
 
 ?>
 
 </body>
 
 </html>
 
 Yo creo que el problema esta en en el formulario. Pero no lo puedo pillar.
 espero me ayuden. Saludos
- 
				La etiqueta <form> va dentro de la etiqueta <body>, y no antes de <html>
 
 Este es el orden
 <!--html--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>HTML </td></tr><tr><td id='CODE'><!--html1--><html>
 <head><title></title></head>
 <body>
 <form>
 </form>
 </body>
 </html><!--html2--></td></tr></table><div class='postcolor'><!--html3-->