Foros del Web » Programando para Internet » PHP »

Error al tratar de actualizar tabla

Estas en el tema de Error al tratar de actualizar tabla en el foro de PHP en Foros del Web. Estoy tratando de poder actualizar una tabla pero cuando le ingreso los datos al formulario y apreto el boton actualizar que me deberia mandar los ...
  #1 (permalink)  
Antiguo 28/03/2007, 00:18
Avatar de Coala  
Fecha de Ingreso: marzo-2007
Ubicación: Chile/Santiago
Mensajes: 150
Antigüedad: 17 años, 1 mes
Puntos: 0
Error al tratar de actualizar tabla

Estoy tratando de poder actualizar una tabla pero cuando le ingreso los datos al formulario y apreto el boton actualizar que me deberia mandar los datos a la segunda pagina pero se cae la pagina (error 404).


El codigo esta dividido en dos partes.
1-actualiza.php :recive los datos en formulario y tiene una tabla con una select y los muestra en la misma pag.
2-procesa_actualizar.php :Procesa el update, con los datos que se le envian desde actualizar.php

Debe ser algun error tonto mio, que no lo pillo

actualizar.php
Código PHP:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>
<body>
<FORM ACTION="procesa_actulizar.php"> 
<TABLE> 
<TR> 
   <TD>Rut:</TD> 
   <TD><INPUT TYPE="text" NAME="caja_rut" SIZE="20" MAXLENGTH="30"></TD> 
</TR> 
<TR> 
   <TD>Nombre:</TD> 
   <TD><INPUT TYPE="text" NAME="caja_nombre" SIZE="20" MAXLENGTH="30"></TD> 
</TR> 
<TR> 
   <TD>Apellido:</TD> 
   <TD><INPUT TYPE="text" NAME="caja_apellido" SIZE="20" MAXLENGTH="30"></TD> 
</TR> 
</TABLE> 
<INPUT TYPE="submit" NAME="accion" VALUE="Actualizar"> 
</FORM> 
<?php 
   
include("conex.php"); 
   
$link=Conectarse(); 
   
$result=mysql_query("select * from cliente",$link); 
?> 
   <hr />
   <center> <p>Registros Base de Datos </p></center> 
   <TABLE BORDER=1 CELLSPACING=1 CELLPADDING=1 align="center"> <TR><TD>&nbsp;Rut</TD><TD>&nbsp;Nombre&nbsp;</TD><TD>&nbsp;Apellido&nbsp;</TD></TR> 
<?php       
   
while($row mysql_fetch_array($result)) { 
      
printf(" <tr><td>&nbsp;%s</td> <td>&nbsp;%s&nbsp;</td> <td>&nbsp;%s&nbsp;</td></tr>",$row["rut_cliente"],$row["nom_cliente"], $row["ape_cliente"]); 
   } 
   
mysql_free_result($result); 
   
mysql_close($link);    
?> 
</table> 
</body> 
</html>
2-procesa actualizar

Código PHP:
<?php 
ob_start
();
?>
<!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=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body>
<?php 
   
include("conex.php"); 
   
$link=Conectarse(); 
   
$id=$_GET['caja_rut']; 
   
mysql_query("update cliente set rut_cliente='$caja_rut',nom_cliente='$caja_nombre',ape_cliente='$caja_apellido' 
   where(rut_cliente = '$id')"
,$link); 
   
header("Location: actualizar.php"); 
?>
</body>
<?php
ob_end_flush
();
?>  
</html>
Pd:Ahun no pueod revisar que el segundo code este funcionando , ya que se cae antes, si se ve algo malo avisenme ..^^
  #2 (permalink)  
Antiguo 28/03/2007, 00:28
 
Fecha de Ingreso: abril-2006
Ubicación: Colombia
Mensajes: 648
Antigüedad: 18 años
Puntos: 3
Re: Error al tratar de actualizar tabla

Hola

Bueno, pues mira el form action, lo tienes con action="procesa_actulizar.php" y deberia ser action="procesa_actualizar.php" correcto?? revisa eso.
__________________
Suerte.
_______________________________
"La vida es el principio de la muerte".
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 14:32.