Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/10/2004, 10:17
Avatar de claudiovega
claudiovega
 
Fecha de Ingreso: octubre-2003
Ubicación: Puerto Montt
Mensajes: 3.667
Antigüedad: 20 años, 6 meses
Puntos: 11
yo en lugar de javascript uso sólo php, asi:

formulario.html

<form name="xxx" action="procesa.php" method="post">
<input name="borrar" type="submit" value="Borrar">
<input name="modificar" type="submit" value="Modificar">
</form>

procesa.php

<?php
if(isset($_POST['borrar']))
{
delete from tabla where .....
header("location: formulario.html")
exit();
}
if(isset($_POST['modificar']))
{
update tabla where .....
header("location: formulario.html")
exit();
}
?>

cada bloque if hace lo suyo, segun el boton que se presionó y luego vuelve a la pagina del formulario, si en esa pagina se obtienen los datos desde la bd se verán automáticamente los cambios.

Última edición por claudiovega; 07/10/2004 a las 10:19