Ver Mensaje Individual
  #14 (permalink)  
Antiguo 03/03/2011, 14:58
Avatar de s00rk
s00rk
 
Fecha de Ingreso: octubre-2010
Ubicación: Mexico
Mensajes: 238
Antigüedad: 13 años, 6 meses
Puntos: 48
Respuesta: Ayuda a encontrar fallo en codigo

Bueno ahora si ya revise mejor esto y asi deveria ya funcionar:

Código PHP:
Ver original
  1. <?php
  2. # FileName="Connection_php_mysql(dot)htm"
  3. # Type="MYSQL"
  4. # HTTP="true"
  5. $hostname = "localhost";
  6. $username = "user";
  7. $password = "pwd";
  8. $bd = "gspyafmr_AGENDA2011";
  9. $nombre = $_POST['nombre'];  
  10. $telefono = $_POST['telefono'];
  11. $dia_mes = $_POST['dia_mes'];
  12. $hora = $_POST['hora'];
  13. $cita = $dia_mes."-".$hora;
  14.  
  15. $conx = mysql_connect($hostname, $username, $password) or trigger_error(mysql_error(),E_USER_ERROR);
  16. mysql_select_db($bd, $conx);
  17. $novacita = "INSERT INTO citas ([hora], [nombre], [telefono]) VALUES ('$cita', '$nombre', '$telefono')";
  18. mysql_query ($novacita, $conx);
  19.  
  20. $header = 'From: ' . $nombre . " \r\n";
  21. $header .= "X-Mailer: PHP/" . phpversion() . " \r\n";
  22. $header .= "Mime-Version: 1.0 \r\n";
  23. $header .= "Content-Type: text/plain";
  24.  
  25. $mensaje .= "Nombre: " . $nombre . " \r\n";
  26. $mensaje .= "Teléfono: " . $telefono . " \r\n";
  27. $mensaje .= "Dia ". $dia_mes . " \r\n";
  28. $mensaje .= "Hora ". $hora . " \r\n";
  29. $mensaje .= "Cita pedida el " . date('d/m/Y', time());
  30.  
  31.  
  32. $para = "[email protected]";
  33. $asunto = 'Cita previa';
  34.  
  35.  
  36. mail($para, $asunto, utf8_decode($mensaje), $header);
  37.  
  38.  
  39. ?>
  40. </h2>
  41. <h2 align="center">Gracias!</h2>
  42.  
  43. <p align="center">Tu cita ha sido registrada correctamente.</p>
  44. <form id="form" name="form" method="post" action="">
  45.   <label>
  46.     <div align="center">
  47.       <input type="button" name="Cerrar" id="Cerrar" value="Cerrar" onclick="window.close();"/>
  48.     </div>
  49.   </label>
  50. </form>
  51. <p align="center"> </p>
  52. <p><span style="color:red;font-size:150%;font-weight:bold;"><?php print $email; ?></span></p>
  53. <noscript>
  54. </noscript>