View Full Version : PLEASE HELP! contact form problem

07-01-2011, 11:45 AM
I have a problem with this form, when I receive the email, no information appear, just blank space. if you know what is the problem please let me know

/* Subject */

$emailSubject = 'PHP scripting';
$webMaster = 'mhtoscano@gmail.com';

/* Gathering data */

$nombreyapellido = $_POST['nombreyapellido'];
$correoelectrónico = $_POST['correoelectrónico'];
$teléfono = $_POST['teléfono'];
$comentario = $_POST['COMENTARIO'];

$body = <<<EOD
Name: $nombreyapellido <br>
Email: $correoelectrónico <br>
Teléfono: $teléfono <br>
Comentario: $COMENTARIO <br>

$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);

/* the results */

$theResults = <<<EOD
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body {
background-color: #f1f1f1;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #666666;
text-decoration: none;

<div align="left">¡Gracias por tu correo! Te contactaremos en breve.</div>
echo "$theResults";


<form action="contactform.php" method="post" id="form">
<div class="wrapper">
<div class="col-1">
<div class="form"> <span>
<input type="text" id="nombreyapellido" onfocus="if(this.value=='nombre y apellido'){this.value=''}" onblur="if(this.value==''){this.value='nombre y apellido'}" value="nombre y apellido" />
</span> </div>
<div class="form"> <span>
<input type="text" id="correoelectrónico" onfocus="if(this.value=='correo electrónico'){this.value=''}" onblur="if(this.value==''){this.value='correo electrónico'}" value="correo electrónico" />
</span> </div>
<div class="form"> <span>
<input type="text" id="teléfono" onfocus="if(this.value=='teléfono'){this.value=''} " onblur="if(this.value==''){this.value='teléfono'}" value="teléfono" />
</span> </div>
<div class="col-2">
<div class="form1"><span>
<textarea cols="1" rows="1" id="COMENTARIO">COMENTARIO:</textarea>
<div class="alignright"><a href="#" onclick="document.getElementById('form').reset()"> reset</a> &nbsp; &nbsp; <a href="#" onclick="document.getElementById('form').submit()" >submit</a></div>

07-01-2011, 01:09 PM
The problem looks like the way you have included the variables in the body of your mail message. I'd expect to see each variable fed in individually with a ; after it. That's where I'd start looking anyway.

07-01-2011, 09:12 PM
Thanks a lot for your answer, I have tried that as well but nothing.
If you have any other ideas please let me know