Maybe you could provide a suggestion/guidance/fix as to why this form isn’t sneding the Form info to the email address, please?
This page is named: form_handle.php
<?php
// create an empty error array to hold any error messages\\
$error = array();
$mailto = 'generic-email123@hotmail.com';
$mailsubj = "Contact Form submission";
$mailhead = "From:Vfrom\
";
$mailbody = "--- Contact form results ---\
";
foreach($_REQUEST as $key => $value)
{
if($key != 'PHPSESSID')
{
$mailbody .= $key.": ".$value."\
";
}
}
if(isset($_POST['ans']) && $_POST['ans']!='hot')
{
// add error to error array
$error[] = '<h2>;Wrong Answer. Please Try Again<br/></h2>';
}
// if the check box is not checked it will not appear in the $_POST values, it's better to use isset rather than empty
if(!isset($_POST['agree']))
{
// add error to error array
$error[] = "<h2>Please read the Terms and then check the 'Agree' check box<br/>";
}
// if no errors are set, continue
if(empty($error))
{
$mailbody .= date('Y-m-d H:i:s',strtotime("now"));
mail($mailto, $mailsubj, $mailbody, $mailhead);
echo "<h2>Thank You<br/></h2>";
//print_r($_REQUEST);
}
// print error messages if available
if(!empty($error))
{
foreach($error as $err) {
echo $err.'<br />';
}
?>
<h2><a href="#" onclick="javascript:history.go(-1); return false">Return To Previous Page</h2></a>
<?
}
?>
<html>
<body>
<!--Begin Logo-->
<div class="container1">
<div id="logo">
</div>
</div>
</body>
</html>
?>
And here’s the html form code:
<div class="form">
<form action='form_handle.php' method='post' name='myform' onSubmit="return checkemail()">
<table border='0' padding='0' spacing='20' >
<tr>
<td>Contact Name:</td>
<td><input type='text' size='20' name='contact_name'>
<br /><br/>
</td>
</tr>
<tr>
<td>Email Address:</td>
<td><input type='text' size='20' name='email_address'>
<br /><br/>
</td>
</tr>
<tr>
<td><br/><font size="1" color="#000000" face="Arial"></td>
<td><textarea name='Description' rows='8' cols='40'></textarea>
<input type='hidden' name='form_filename' id ='form_filename' value='empty'>
<br /><br/></td>
</tr>
<td></td>
</tr>
<td><input type="checkbox" name="agree" id="agree" value="agree" /> <label for='agree'>Check Box To Agree To The
<a href="http://www.somewebsite.com/page.php?page=1"><font size="2" color="#000000" face="Arial"><u>Terms</u></a></font>?</label></td>
<tr>
<td colspan='2' align='left'><input type='submit' value = 'Save' src="../images/v.gif"></td>
</tr>
</table>
</form>