Hola, tengo este código:
Código PHP:
Ver original<?php
# FileName="Connection_php_mysql(dot)htm"
# Type="MYSQL"
# HTTP="true"
$hostname = "localhost";
$username = "user";
$password = "pwd";
$nombre = $_POST['nombre'];
$telefono = $_POST['telefono'];
$dia_mes = $_POST['dia_mes'];
$hora = $_POST['hora'];
$cita = "('$dia_mes', '$hora')";
$bd = "gspyafmr_AGENDA2011";
$novacita = "INSERT INTO [citas] ([hora], [nombre], [telefono] VALUES ('$cita', '$nombre', '$telefono')";
$header = 'From: ' . $nombre . " \r\n";
$header .= "X-Mailer: PHP/" . phpversion() . " \r\n"; $header .= "Mime-Version: 1.0 \r\n";
$header .= "Content-Type: text/plain";
$mensaje .= "Nombre: " . $nombre . " \r\n";
$mensaje .= "Teléfono: " . $telefono . " \r\n";
$mensaje .= "Dia ". $dia_mes . " \r\n";
$mensaje .= "Hora ". $hora . " \r\n";
$mensaje .= "Cita pedida el " . date('d/m/Y', time());
$asunto = 'Cita previa';
?>
</h2>
<h2 align="center">Gracias!</h2>
<p align="center">Tu cita ha sido registrada correctamente.</p>
<form id="form" name="form" method="post" action="">
<label>
<div align="center">
<input type="button" name="Cerrar" id="Cerrar" value="Cerrar" onclick="window.close();"/>
</div>
</label>
</form>
<p align="center"> </p>
<p><span style="color:red;font-size:150%;font-weight:bold;"><?php print $email; ?></span></p>
<noscript>
</noscript>
alguien podría hecharme una mano a ver dode está el fallo, es el archivo enviar.php de un form y la idea es que envie los datos por mail (eso funciona bien) y los introduzca en la bd mysql.
Gracias a todos.