0 Replies Latest reply on Feb 11, 2010 9:11 AM by DiegoDiazCuellar

    contact form problems

    DiegoDiazCuellar Level 1

      Hi I have a contact form whit two files:

       

      The first is contacto.php and have the next code:

       

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <title>Untitled Document</title>
      </head>
      <body>
      <table height="390" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td align="left" valign="top"> </td>
          <td align="left" valign="top"><p class="style18">Realice su consulta y en la m&aacute;xima brevedad recibir&aacute; una respuesta</p>
            <div id="bloque_1a">
              <form action="envia.php" method="post">
                <label><span class="style10">Nombre/Raz&oacute;n Social</span><br />
                </label>
                <input type="text" name="razon" size="40" />
                <br />
                <br />
                <label><span class="style10">Persona de Contacto</span></label>
                <span class="style22">&#42;</span><br />
                <input type="text" name="name" size="40" />
                <br />
                <br />
                <label><span class="style10">E-mail</span></label>
                <span class="style22">&#42;</span><br />
                <input name="email" type="text" size="40" />
                <br />
                <br />
                <label class="style10">Tel&eacute;fono </label>
                <br />
                <input type="text" name="phone" />
                <br />
                <br />
                <label><span class="style10">Su Web</span></label>
                <span class="style22">&#42;</span><br />
                <textarea name="web" cols="40">www.</textarea>
                <br />
                <br />
                <label class="style10">Criterios de B&uacute;squeda</label>
                <br />
                <textarea cols="40" rows="2" name="criterios"></textarea>
                <br />
                <br />
                <label>
                <span class="style10">Motivo de la Consulta</span> <br />

                <input type="checkbox" name="check[]" value="popularidad" />

                <span class="style25">Servicio Popularidad</span><br />

                <input type="checkbox" name="check[]" value="cumbre" />

                <span class="style25">Servicio Cumbre</span><br />

                <input type="checkbox" name="check[]" value="diseno_web" />

                <span class="style25">Diseño Web</span><br />

                <input type="checkbox" name="check[]" value="configuracion_googlemaps" />

                <span class="style25">Configuración de Google Maps</span><br />

                <input type="checkbox" name="check[]" value="configuracion_facebook" />

                <span class="style25">Configuración de Facebook</span><br />

                <input type="checkbox" name="check[]" value="optimizacion_profesional" />

                <span class="style25">Optimización Profesional</span> <br />
                <br />
                <label class="style10">Otros Datos</label>
                <br />
                <textarea cols="40" rows="4" name="datos">
        </textarea>
                <br />
                <br />
                <p style="padding-left:200px">
                  <input name="envio" type="submit" class="button" style="color:#004A99" value="Enviar" />
                </p>
                <label class="style10">&#42; Campos Obligatorios</label>
                    </form></td>
        </tr>
      </table>
      </body>
      </html>

       

      And the second one hace this code:

       

      <?
      if(!empty($_POST['envio'])){

          $emailTo = "josediegodiaz@yahoo.com";
          $sub = "Contacto con Espacioos.com ".trim(stripslashes($_POST['sub']));
          $razon = trim(stripslashes($_POST['razon']));
          $name = trim(stripslashes($_POST['name']));
          $email = trim(stripslashes($_POST['email']));
          $phone = trim(stripslashes($_POST['phone']));
          $web = trim(stripslashes($_POST['web']));
          $criterios = trim(stripslashes($_POST['criterios'])); 
          $motivo = trim(stripslashes($_POST['motivo']));
          $datos = trim(stripslashes($_POST['datos']));
          $emailFrom = trim(stripslashes($_POST['email']));

          foreach($_POST['check'] as $value) {

      $check_msg .= "Checked: $valuen";

      }
        
          $validationOK=true;
          if (trim($emailFrom)=="") $validationOK=false;
          if (trim($name)=="") $validationOK=false;
          if (trim($email)=="") $validationOK=false;
          if (!$validationOK) {
              print "";
          } else {
              $Body = "";
              $Body .= "Razon social: ";
              $Body .= $razon;
              $Body .= "n";
              $Body .= "Persona de contacto: ";
              $Body .= $name;
              $Body .= "n";
              $Body .= "E-mail: ";
              $Body .= $email;
              $Body .= "n";
              $Body .= "Telefono: ";
              $Body .= $phone;
              $Body .= "n";
              $Body .= "Su Web: ";
              $Body .= $web;
              $Body .= "n";
              $Body .= "Criterios de busqueda: ";
              $Body .= $criterios;
              $Body .= "n";
              $Body .= "Checked: ";
              $Body .= $check_msg;
              $Body .= "n";
              $Body .= "Otros datos: ";
              $Body .= $datos;
              $Body .= "n";

              $success = mail($emailTo, $sub, $Body, "From: <$emailFrom>");

              if ($success){
                    print "";
              } else {
                    print "";
              }
          }
      }
      ?>

       

      • Problem number one: When the people click at the check box it select's two or more checkbox (no one).
      • Problem number two: the php it's not sending me anything to my email.

       

      I put the files to view it.

       

      THANKS ....