Foros del Web » Programando para Internet » Javascript » Frameworks JS »

Problemas con formulario

Estas en el tema de Problemas con formulario en el foro de Frameworks JS en Foros del Web. Hola a todos. Resulta que encontre un formulario en php que se acomoda a lo que necesito, pero no me está enviando los datos a ...
  #1 (permalink)  
Antiguo 12/02/2010, 10:16
Avatar de ccs_diego  
Fecha de Ingreso: diciembre-2008
Ubicación: Bogota
Mensajes: 40
Antigüedad: 15 años, 4 meses
Puntos: 1
Problemas con formulario

Hola a todos.

Resulta que encontre un formulario en php que se acomoda a lo que necesito, pero no me está enviando los datos a mi correo electronico. No se cual sera el problema ya que mi fuerte no es la programacion.

Dejo el enlace para que lo miren y el enlace para que lo descarguen.

skpepublicidad.com/clientes/makro/formulario_contacto/contact.html

skpepublicidad.com/pruebas/Ajax-Contact-Form.zip

Agradeceria cualquier ayuda o guia.

GRACIAS
  #2 (permalink)  
Antiguo 12/02/2010, 10:18
Avatar de CHuLoSoY  
Fecha de Ingreso: febrero-2002
Ubicación: Ribeira (Galicia)
Mensajes: 1.900
Antigüedad: 22 años, 3 meses
Puntos: 29
Respuesta: Problemas con formulario

Podrías poner el código aquí en vez de tener que andar a descargar.
__________________
ESQUIO Dominios y Hosting
Las mejores características con los mejores precios.
  #3 (permalink)  
Antiguo 12/02/2010, 10:23
Avatar de ccs_diego  
Fecha de Ingreso: diciembre-2008
Ubicación: Bogota
Mensajes: 40
Antigüedad: 15 años, 4 meses
Puntos: 1
Respuesta: Problemas con formulario

Lo que pasa es que son varios archivos ...

Este es el HTML


Código HTML:
<!--
/************* Ajax Contact Form 1.0 *****************************/
/*
Released by AwesomePHP.com, under the GPL License, a
copy of it should be attached to the zip file, or
you can view it on http://AwesomePHP.com/gpl.txt
*/
/************* Ajax Contact Form 1.0 *****************************/
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Ajax Enabled PHP Contact Form</title>
<style type="text/css">
td
{	
	border:1px solid gray;
	font-size:12px;
}
.header
{
	background-color:#CCCCCC;
	font-size:20px;
}
.error
{
	background-color:#FFBFBF;
	color:#FF0000;
	font-size:14px;
}
*
{
	font-family:Verdana, Arial, Helvetica, sans-serif;
}
textarea,.textbox
{
	width:100%;
	border:1px solid gray;
}
</style>
</head>
<script type="text/javascript" src="formProcess.js"></script>
<body>
<form name="contact" id="contact" method="post" action="contact.html" style="display:inline;">
  <table width="70%"  border="0" align="center" cellpadding="5" cellspacing="0">
    <tr>
      <td colspan="2" class="header"><div align="center">Contact Form: </div></td>
    </tr>
    <tr id="errorSpanTR" style="display:none;">
      <td colspan="2" class="error"><span id="errorSpan"></span></td>
    </tr>
    <tr>
      <td width="50%">Please enter your name: </td>
      <td width="50%"><input name="customerName" type="text" id="customerName" class="textbox"></td>
    </tr>
    <tr>
      <td width="50%">Please enter your email: </td>
      <td width="50%"><input name="customerEmail" type="text" id="customerEmail" class="textbox"></td>
    </tr>
    <tr>
      <td width="50%">Please enter your telephone: </td>
      <td width="50%"><input name="customerPhone" type="text" id="customerPhone" class="textbox"></td>
    </tr>
    <tr>
      <td width="50%">What should we use to call you back: </td>
      <td width="50%"><input name="callBackMethod" type="radio" value="Phone">
        Phone 
          <input name="callBackMethod" type="radio" value="Email" checked> 
          E-Mail
</td>
    </tr>
    <tr>
      <td width="50%">What time should we call you back (if by phone):</td>
      <td width="50%"><select name="callBackHour" id="callBackHour">
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3" selected>3</option>
        <option value="4">4</option>
        <option value="5">5</option>
        <option value="6">6</option>
        <option value="7">7</option>
        <option value="8">8</option>
        <option value="9">9</option>
        <option value="10">10</option>
        <option value="11">11</option>
        <option value="12">12</option>
      </select>
        : 
        <select name="callBackMinutes" id="callBackMinutes">
          <option value="00">00</option>
          <option value="05">05</option>
          <option value="10">10</option>
          <option value="15" selected>15</option>
          <option value="20">20</option>
          <option value="25">25</option>
          <option value="30">30</option>
          <option value="35">35</option>
          <option value="40">40</option>
          <option value="45">45</option>
          <option value="50">50</option>
          <option value="55">55</option>
                        </select> <select name="callBackHoursSpan" id="callBackHoursSpan">
                          <option value="AM">AM</option>
                          <option value="PM" selected>PM</option>
                                                                        </select> </td>
    </tr>
    <tr>
      <td>What department should call you back: </td>
      <td width="50%"><select name="departmentInterested" id="departmentInterested">
        <option value="Support" selected>Support</option>
        <option value="Billing">Billing</option>
        <option value="Complaints">Complaints</option>
      </select></td>
    </tr>
    <tr>
      <td>What services are you interested in: </td>
      <td width="50%"><input name="serverInterested[]" type="checkbox" id="serverInterested[]" value="WebDesign">
      Web Design 
        <input name="serverInterested[]" type="checkbox" id="serverInterested[]" value="WebHosting">
Web Hosting 
<input name="serverInterested[]" type="checkbox" id="serverInterested[]" value="WebProgramming"> 
Web Programming
</td>
    </tr>
    <tr>
      <td colspan="2">Please enter your message: </td>
    </tr>
    <tr>
      <td colspan="2"><div align="center">
        <textarea name="customerMessage" id="customerMessage"></textarea>
      </div></td>
    </tr>
    <tr>
      <td colspan="2"><div align="center">
        <input type="button" name="Button" value="Send This Information" onClick="submitForm();">
      </div></td>
    </tr>
  </table>
</form>
</body>
</html> 
ESTE ES EL PHP
Código PHP:
Ver original
  1. <?php
  2. /************* Ajax Contact Form 1.0 *****************************/
  3. /*
  4. Released by AwesomePHP.com, under the GPL License, a
  5. copy of it should be attached to the zip file, or
  6. you can view it on http://AwesomePHP.com/gpl.txt
  7. */
  8. /************* Ajax Contact Form 1.0 *****************************/
  9.  
  10. /* Emails to send admins (comma separated) */
  11. $toEmails = '[email protected]';
  12.  
  13. /* Site Name */
  14. $siteName = 'Ajax Contact Form Demo';
  15.  
  16. /* Email Subject for admins */
  17. $subject = 'You\'v Got Mail';
  18.  
  19. /* Email subject for users making the contact*/
  20. $subjectUser = 'ESTO ES UN FORMULARIO DE PRUEBA CON AJAX';
  21.  
  22. /* Email message to send users making the contact*/
  23. $userMessage = "Esto es un correo de confirmacion de que usted nos ha escrito";
  24. /* Email message add-on if also sending variables (information) */
  25. $userMessageVariables =
  26. "Here is the information you sent us:\n<br />
  27. -------------------------------------------------\n<br />";
  28.  
  29. /* Thank you message on page */
  30. $thankYouNote = 'Su mensaje ha sido enviado gracias.';
  31.  
  32. /* Send Thank you Email to sender */
  33. $sendThankYou = true;
  34.  
  35. /* Include form variables in Thank you Email */
  36. $sendVariable = true;
  37.  
  38. /* Email field to send thank you to */
  39. $thankYouEmailField = 'customerEmail';
  40.  
  41. /* Do you want to require any fields ?*/
  42. $REQUIRE[] = 'customerName';
  43. $REQUIRE[] = 'customerMessage';
  44.  
  45. /* Email fields to check for validation */
  46. /*
  47. If you want an email field to be required, it should
  48. also be on the REQUIRE list
  49. */
  50. $EMAILFIELD[] = 'customerEmail';
  51.  
  52.  
  53. ?>

Pero hay otros archivos en .js y .txt
  #4 (permalink)  
Antiguo 12/02/2010, 10:25
Avatar de CHuLoSoY  
Fecha de Ingreso: febrero-2002
Ubicación: Ribeira (Galicia)
Mensajes: 1.900
Antigüedad: 22 años, 3 meses
Puntos: 29
Respuesta: Problemas con formulario

En el php no existe ninguna función para enviar email.
http://www.desarrolloweb.com/articulos/1048.php
Código PHP:
Ver original
  1. mail($direccionDeCorreo,"Asunto",$cuerpo);
__________________
ESQUIO Dominios y Hosting
Las mejores características con los mejores precios.
  #5 (permalink)  
Antiguo 12/02/2010, 10:38
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Tema movido desde PHP a AJAX
  #6 (permalink)  
Antiguo 12/02/2010, 10:40
Avatar de ccs_diego  
Fecha de Ingreso: diciembre-2008
Ubicación: Bogota
Mensajes: 40
Antigüedad: 15 años, 4 meses
Puntos: 1
Respuesta: Problemas con formulario

Gracias por la informacion.

En el articulo que presentan a ese formulario necestio adicionarle un menu list.
Entonces lo que hice fue agregarle una lista de menu al codigo:

Código HTML:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title>Mándanos tus comentarios</title>
</head>

<body bgcolor="#cccc66" text="#003300" link="#006060" vlink="#006060">
<?
if (!$HTTP_POST_VARS){
?>
<form action="envia_form_php.php" method=post>
Nombre: <input type=text name="nombre" size=16>
<br>
Email: <input type=text name=email size=16>
<br>
Comentarios: <textarea name=coment cols=32 rows=6></textarea>
<br>
<br>
asdfasdfsa
<label>
<select name="lista" id="lista">
  <option value="opcion1">opcion 1</option>
  <option value="opcion2">opcion 2</option>
  <option value="opcion3">opcion 3</option>
</select>
</label>
<br>
<input type=submit value="Enviar">
</form>
<?
}else{
    //Estoy recibiendo el formulario, compongo el cuerpo
    $cuerpo = "Formulario enviado\n";
    $cuerpo .= "Nombre: " . $HTTP_POST_VARS["nombre"] . "\n";
    $cuerpo .= "Email: " . $HTTP_POST_VARS["email"] . "\n";
    $cuerpo .= "Comentarios: " . $HTTP_POST_VARS["coment"] . "\n";
    $cuerpo .= "Lista:" .$HTTP_POST_VARS["lista"] . "\n";

    //mando el correo...
    mail("[email protected]","Formulario recibido",$cuerpo);

    //doy las gracias por el envío
    echo "Gracias por rellenar el formulario. Se ha enviado correctamente.";
}
?>
</body>
</html> 
Sera que esta bien??? GRACIAS

Etiquetas: ajax, formulario
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 22:43.