He creado este sencillo formulario.
<html>
<body>
<?php
if ($enviar) {
// process form
$link = mysql_connect("localhost", "xxxxx", "x");
mysql_select_db("$mydb",$db);
$sql = "INSERT INTO agenda (nombre, direccion, telefono, email) ";
$sql .= "VALUES ('$nombre', '$direccion', '$telefono', '$email')";
$result = mysql_query($sql);
echo "¡Gracias! Hemos recibido sus datos.\n";
}else{
?>
<form method="post" action="hola.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>
<?php
} //end if
?>
</body>
</html>
He creado la tabla agenda en la base datos y no me conecta que fallo hay?
Gracias