Ver Mensaje Individual
  #2 (permalink)  
Antiguo 26/08/2008, 08:17
revtrib
 
Fecha de Ingreso: agosto-2008
Ubicación: Medellin
Mensajes: 7
Antigüedad: 15 años, 8 meses
Puntos: 0
Respuesta: Agregar registros

Hola. Porque no sacas el formulario del else:
<?php
if (isset($_POST['txtNombre'])) {
@mysql_query("INSERT INTO ciudades SET nombre = '" . $_POST['txtNombre'] . "'");
echo 'Ciudad agregada correctamente';
}
?>
<form action="ciudades.php" method="post" name="frmDatos" id="frmDatos">
<label>Nombre:</label>
<br>
<input type="text" name="txtNombre" id="txtNombre">
<input type="submit" name="cmdAceptar" id="cmdAceptar" value="Aceptar">
</form>
<?php


de esta manera, si no existe post, simplemente el formulario aparece. Pero si existe post, entonces te carga el mensaje y luego el formulario de nuevo.

Espero te sirva la info!