
15/11/2007, 03:09
|
| | Fecha de Ingreso: noviembre-2007
Mensajes: 51
Antigüedad: 17 años, 4 meses Puntos: 0 | |
Re: por que no inserta los datos???? ya le puse el if (isset($_POST[enviar])) {
y en sus variables el $_POST
y aunque no me da errores no me inserta los datos del formulario en la bse de datos.
A que se debera¿????
Este el el codigo a el completo:
<?php
if(isset($_POST['enviar'])){
// process form
$link = mysql_connect("localhost","root","asge");
mysql_select_db("telefonos",$link);
$sql = "INSERT INTO 'telefonos_datos' ('NOMBRE', 'EXTEN_MOVIL', 'TLFNO', 'CABEZA DE GRUPO') ";
$sql .= "VALUES ('".$_POST['nombre']."', '".$_POST['extension']."', '".$_POST['telefono']."', '".$_POST['cabeza_grupo']."')";
$result = mysql_query($sql);
echo "¡Gracias! Hemos recibido sus datos.\n";
}else{
?>
</div>
<form method="post" action="<?$_SERVER['PHP_SELF']?>">
<div align="left">Nombre Apellidos:
<input type="Text" name="NOMBRE_APELLIDOS">
<br>
Extensión:
<input type="Text&quo>Dirección:<input type="Text" name="EXTEN_MOVIL">
<br>
Teléfono :
<input type="Text" name="TLFNO">
<br>
Cabeza de grupo :
<input type="Text" name="CABEZA_DE_GRUPO">
<br>
<input type="Submit" name="enviar" value="Aceptar información">
</div>
</form>
<div align="left">
<?php
} //end if
?>
</div>
</body>
</html> |