Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/12/2007, 19:33
Avatar de a83
a83
 
Fecha de Ingreso: noviembre-2005
Ubicación: Santiago de chile
Mensajes: 637
Antigüedad: 18 años, 5 meses
Puntos: 1
Pregunta problemas al resfrescar el formulario

hola estimados ,


tengo el siguiente problema cada ves que le doy nuevo o refrescar se me ingresa un reguistro a la base de datos .

este es el cod:

Código PHP:
<link href="tablecloth/tablecloth.css" rel="stylesheet" type="text/css" />
<form id="form1" name="form1" method="post" action="guar.php">

<p>Referencia:</p>
<p><a href="ver.php">ver</a></p>
<p>&nbsp;</p>
<table width="767" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <th width="767" class="even" scope="row"><label>
      <input name="nombre" type="text" class="selected" id="nombre">
    </label></th>
    <th width="767" scope="row">&nbsp;</th>
  </tr>
  <tr>
    <th class="even" scope="row"><label>
      <input name="apellido" type="text" id="apellidos">
    </label></th>
    <th scope="row">&nbsp;</th>
  </tr>
  <tr>
    <th class="even" scope="row"><label>
      <input name="dni" type="text" id="dni">
    </label></th>
    <th scope="row">&nbsp;</th>
  </tr>
  <tr>
    <th class="even" scope="row"><label>
      <input type="submit" name="Submit" value="Enviar">
    </label></th>
    <th scope="row">&nbsp;</th>
  </tr>
</table>
<p>&nbsp;</p>
</form>

Y este el codigo php:
<?php
$conexion
=mysql_connect("localhost","root",""
or die(
"Problemas en la conexion");
mysql_select_db("compras",$conexion) or
die(
"Problemas en la seleccion de la base de datos");
mysql_query("insert into usuarios(id,nombre,apellido,dni) values 
('$_REQUEST[id]','$_REQUEST[nombre]','$_REQUEST[apellido]','$_REQUEST[dni]')"

$conexion) or die("Problemas en el select".mysql_error());
mysql_close($conexion);
echo 
" fue Gurdado.";
?>

si me pueden ayudar