The following is my code. However I can send the form and it gives me an error page and doesn’t require the captcha to be entered. Any help is much appreciated.
<?php
session_start();
if(isset($_POST[‘submit’])) {
if(!empty($_POST[‘Name’]) && !empty($_POST[‘Email’]) && !empty($_POST[‘Phone’]) && !empty($_POST[‘Comments’]) && !empty($_POST[‘code’])) {
if($_POST[‘code’] == $_SESSION[‘rand_code’]) {
// send email
$accept = “Thank you for contacting me.”;
} else {
$error = “Please verify that you typed in the correct code.”;
}
} else {
$error = “Please fill out the entire form.”;
}
}
?>
<style type=”text/css”>
body,td,th {
font-family: “Times New Roman”, Times, serif;
color: #FFF;
}
body {
background-color: #000;
}
a:link {
color: #9CF;
}
a:visited {
color: #FCF;
}
a:hover {
color: #C9C;
}
a:active {
color: #96F;
}
#header {
}
#babypics {
}
#InfantPhotography {
font-family: “Brush Script MT”;
font-size: 36px;
color: #F5B9F7;
font-weight: bold;
text-align: center;
margin-top: 15px;
margin-right: 275px;
margin-bottom: 15px;
margin-left: 15px;
}
#ServingDFW {
font-family: “Times New Roman”, Times, serif;
font-size: 24px;
color: #A4D7E8;
text-align: center;
margin-top: 15px;
margin-right: 275px;
margin-bottom: 15px;
margin-left: 15px;
}
#Printgifts {
margin-top: 15px;
margin-right: 275px;
margin-bottom: 15px;
margin-left: 15px;
}
#Sessions {
font-family: “Brush Script MT”;
font-size: 36px;
color: #99C;
text-align: center;
margin-top: 15px;
margin-right: 275px;
margin-bottom: 15px;
margin-left: 15px;
}
#Price {
font-family: “Times New Roman”, Times, serif;
font-size: 24px;
font-weight: bold;
color: #F0F;
text-align: center;
margin-top: 15px;
margin-right: 275px;
margin-bottom: 15px;
margin-left: 15px;
}
#text {
font-family: “Times New Roman”, Times, serif;
font-size: 18px;
color: #FFF;
text-align: center;
margin-top: 15px;
margin-right: 310px;
margin-bottom: 15px;
margin-left: 50px;
}
#PackageHead {
font-family: “Brush Script MT”;
font-size: 36px;
color: #09F;
text-align: center;
margin-top: 15px;
margin-right: 275px;
margin-bottom: 15px;
margin-left: 15px;
}
#packagedetails {
font-family: “Times New Roman”, Times, serif;
font-size: 16px;
font-weight: bold;
color: #FFF;
list-style-position: inside;
list-style-type: square;
text-align: center;
margin-top: 15px;
margin-right: 275px;
margin-bottom: 15px;
margin-left: 15px;
}
#Setappointmentform {
text-align: center;
margin-top: 15px;
margin-right: 275px;
margin-bottom: 15px;
margin-left: 15px;
}
#footer {
text-align: center;
}
#familypackagesright {
float: right;
width: 250px;
margin: 15px;
padding: 5px;
}
</style>
<title>Children</title>
<script src=”SpryAssets/SpryValidationTextField.js” type=”text/javascript”></script>
<link href=”SpryAssets/SpryValidationTextField.css” rel=”stylesheet” type=”text/css” />
<div id=”header”><?php include_once’template_header.php’?></div>
<div id=”babypics”>
<table width=”200″ border=”0″ align=”center” cellpadding=”5″ cellspacing=”5″>
<tr>
<td><img src=”Sample Images/7.JPG” width=”174″ height=”116″ /></td>
<td><img src=”Sample Images/5 – Copy.jpg” width=”174″ height=”116″ /></td>
<td><img src=”Sample Images/PICT2819.jpg” width=”116″ height=”174″ /></td>
<td><img src=”Sample Images/DSC01135.JPG” width=”174″ height=”116″ /></td>
<td><img src=”Sample Images/PICT6287.JPG” width=”116″ height=”174″ /></td>
</tr>
</table>
</div>
<div id=”familypackagesright”><?php include_once’growing_packages_details.php’?></div>
<div id=”InfantPhotography”>Children Photography</div>
<div id=”ServingDFW”>Serving Fort Worth & Denton County Texas</div>
<div id=”Printgifts”>
<table width=”423″ border=”0″ align=”center” cellpadding=”5″ cellspacing=”5″>
<tr>
<td colspan=”2″ align=”center” valign=”top”><a href=”print_package_prices.php”>Price List</a></td>
<td width=”248″ align=”center” valign=”top”><form action=”
<input type=”hidden” name=”cmd” value=”_s-xclick” />
<input type=”hidden” name=”hosted_button_id” value=”E755J6G65EGBG” />
<input type=”image” src=”
<img alt=”” border=”0″ src=”
</form></td>
</tr>
</table>
</div>
<div id=”Sessions”>Session Price</div>
<div id=”Price”>$125</div>
<div id=”text”>
<p>* Each session is normally about one hour long <br />
(we allow time for kids to be kids)<br />
* Session location is total up to you</p>
</div>
<div id=”PackageHead”>Package Includes</div>
<div id=”packagedetails”>
* $50 Photo Credit<br />
* Online Album of your images(Family and Friends can order all the prints they want)</div>
<div id=”Setappointmentform”>
<p>To Set up an Appointment Contact us<br>
<img src=”webimages/phonenumber.jpg” width=”184″ height=”35″ alt=”Call Us”> <br>
or<br>
<img src=”webimages/emailaddress.jpg” alt=”Email Us” width=”248″ height=”29″ border=”0″ usemap=”#Map”>
<map name=”Map”>
<area shape=”rect” coords=”5,4,246,25″ href=”mailto:
</map>
</p>
<p> </p>
<?php if(!empty($error)) echo ‘<div class=”error”>’.$error.'</div>’; ?>
<?php if(!empty($accept)) echo ‘<div class=”accept”>’.$accept.'</div>’; ?>
<form action=”<?php echo $_SERVER[‘PHP_SELF’]; ?>, appointment.php” method=”post” enctype=”multipart/form-data”>
<label for=”Name”>Name:</label>
<input type=”text” name=”Name” id=”Name”>
<label for=”Email”>Email</label>
<span id=”sprytextfield1″>
<input type=”text” name=”Email” id=”Email” />
<span class=”textfieldRequiredMsg”>A value is required.</span><span class=”textfieldInvalidFormatMsg”>Invalid format.</span></span>
<p>
<label for=”Phone”>Phone</label>
<span id=”sprytextfield2″>
<input type=”text” name=”Phone” id=”Phone” />
(000-000-0000)
<span class=”textfieldRequiredMsg”>A value is required.</span><span class=”textfieldInvalidFormatMsg”>Invalid format.</span></span>
<label for=”Comments”><br>
<br>
Comments</label>
<textarea name=”Comments” id=”Comments” cols=”45″ rows=”5″></textarea>
</p>
<img src=”captcha.php”/>
<p><input type=”text” name=”code” /> Are you human?</p>
<input type=”submit” name=”submit” value=”Send” class=”button” /></p>
</p>
</form>
<p> </p>
</div>
<div id=”footer”><?php include_once’template_footer.php’?></div>
<script type=”text/javascript”>
var sprytextfield1 = new Spry.Widget.ValidationTextField(“sprytextfield1”, “email”, {validateOn:[“blur”, “change”]});
var sprytextfield2 = new Spry.Widget.ValidationTextField(“sprytextfield2”, “phone_number”, {format:”phone_custom”, pattern:”000-000-0000″, hint:”000-000-0000″});
</script>