Tema: ayuda en php
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/05/2006, 16:01
cristian.mbb
 
Fecha de Ingreso: mayo-2006
Mensajes: 35
Antigüedad: 17 años, 11 meses
Puntos: 0
Pregunta ayuda en php

hola soy nuevo en este foro
estoy inicnadome en php y tengo una duda en el ingreso de datos a Mysql
mi duda es:

mi codigp php:
<?
// process form
$link = mysql_connect("localhost", "myuser");
mysql_select_db("mydb",$link);
$sql = "INSERT INTO agenda VALUES ('$nombre','$direccion','$telefono','$email')";
mysql_query($sql);
echo "¡Gracias! Hemos recibido sus datos.\n";
?>


mi codigo html:
<html>
<body>

<form method="post" action="add_reg.php">
Nombre :<input type="Text" name="nombre"><br>
Dirección:<input type="Text" name="direccion"><br>
Teléfono :<input type="Text" name="telefono"><br>
E-mail :<input type="Text" name="email"><br>
<input type="Submit" name="enviar" value="Aceptar información">
</form>

</body>
</html>



al compilar esto en mi servidor web me dice lo siguiente:
Notice: Undefined variable: nombre in d:\archivos de programa\easyphp1-8\www\ejemplos\add_reg.php on line 5

Notice: Undefined variable: direccion in d:\archivos de programa\easyphp1-8\www\ejemplos\add_reg.php on line 5

Notice: Undefined variable: telefono in d:\archivos de programa\easyphp1-8\www\ejemplos\add_reg.php on line 5

Notice: Undefined variable: email in d:\archivos de programa\easyphp1-8\www\ejemplos\add_reg.php on line 5
¡Gracias! Hemos recibido sus datos.

y no me ingresa los datos a MySql, esto x lo veo me dice q no he definido las variables, si me pueden ayduar antemano gracias