Can you tell if I did something wrong with this send form?
Posted: Thu Jun 11, 2009 12:42 am
Hi, I've created a survey but cannot get it to send the results to an email address. I know for sure it did work on the first try but for some reason when I tried to send it again without making any changes to it it wouldn't send. Could anyone tell me if this looks right?
FYI: The "id=contactform" that I use is a contact for I created for the feedback page. I wonder if I'd have to create a different one for the survey...
Thanks in advance!
FYI: The "id=contactform" that I use is a contact for I created for the feedback page. I wonder if I'd have to create a different one for the survey...
Code: Select all
//PHP FOR SENDING SURVEY RESULTS TO EMAIL//////////////////////////
if( isset($_POST["btnSubmit"]) ){
{
${$var} = $val;
}
$body_body .= " Gender: | " . $gender . "\n";
$body_body .= " Age Group: | " . $age . "\n";
$to = 'Admin <admin@pho411.ca>';
$subject = 'Pho411 Survey Results';
$body = $body_body;
mail($to, $subject, $body);
}
/////END OF PHP/////
Code: Select all
/////TPL FILE/////
<form method="post" id="contactForm">
<b>What is your gender?</b>
<br /><br />
<table border="0">
<tr>
<td><input type="radio" name="gender" value="male"> Male </td>
</tr>
<tr>
<td><input type="radio" name="gender" value="female"> Female</td>
</tr>
</table>
<br /><br />
<b>What is your age group?</b>
<br /><br />
<table border="0">
<tr>
<td><input type="radio" name="age" value="under20" /> Under 20 </td>
</tr>
</table>
<br /><br />
<input type="submit" value="submit" name="submit" />
</form>
////END OF TPL////