Hey folks this is my first time posting. Trying to configure Contact Form with Captcha.
Here is my code. Problem is, I am not sure where the problem lies and would hate to just post portions of it and leave out the problem area so I am going to post the entire php/form section and hopefully get some help.
if($_SESSION['security_code'] == $_POST['security_code']){ $success = mail($emailTo, $subject, $body, $headers); if ($success){ echo '<p class="yay">Your e–mail has been sent. We will get back with you soon.</p>'; } } else { echo '<p class="oops">Something went wrong; maybe you clicked it too hard... you did, didn’t you?</p>'; } } else { ?>
Here is my code. Problem is, I am not sure where the problem lies and would hate to just post portions of it and leave out the problem area so I am going to post the entire php/form section and hopefully get some help.
Here is what is returned in the body of my email
Address: 222 El Monte Blvd
Message: test
Code below
<?php
if(isset($_POST['send'])){
$emailFrom = "myemail@somewhere.com";
$emailTo = "my2ndemail@somewherelse.com";
$subject = "Inquiry";
$interest = strip_tags($_POST['interest']);
$name = strip_tags($_POST['name']);
$city = strip_tags($_POST['city']);
$phone = strip_tags($_POST['phone']);
$email = strip_tags($_POST['email']);
$date = strip_tags($_POST['date']);
$bride = strip_tags($_POST['bride']);
$groom = strip_tags($_POST['groom']);
$address = strip_tags($_POST['address']);
$message = strip_tags(stripslashes($_POST['message']));
$body = "Interest: ".$interest."\n";
$body = "Name: ".$name."\n";
$body .= "City: ".$city."\n";
$body = "Phone: ".$phone."\n";
$body .= "Email: ".$email."\n";
$body = "Date: ".$date."\n";
$body = "Bride: ".$bride."\n";
$body = "Groom: ".$groom."\n";
$body = "Address: ".$address."\n";
$body .= "Message: ".$message."\n";
$headers = "From: ".$emailFrom."\n";
$headers .= "Reply-To:".$email."\n";
if($_SESSION['security_code'] == $_POST['security_code']){
$success = mail($emailTo, $subject, $body, $headers);
if ($success){
echo '<p class="yay">Your e–mail has been sent. We will get back with you soon.</p>';
}
} else {
echo '<p class="oops">Something went wrong; maybe you clicked it too hard... you did, didn’t you?</p>';
}
} else {
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" id="contact" name="contact">
<fieldset>
<legend>Contact Personal Information</legend>
<p>
<label for="interest">Interest</label>
<input type="text" id="interest" name="interest" class="required" minlength="2"/>
<label for="name">Name</label>
<input type="text" id="name" name="name" class="required" minlength="2"/>
<label for="citystate">City/State</label>
<input type="text" id="citystate" name="citystate" class="required" minlength="2"/>
<label for="phone">Phone</label>
<input type="text" id="phone" name="phone" class="required" minlength="2"/>
<label for="email">E–mail</label>
<input type="text" id="email" name="email" class="required email"/>
</p>
<legend>Wedding Information</legend><br />
<label for="date">Date</label>
<input type="text" id="date" name="date" class="required"/>
<label for="bride">Bride</label>
<input type="text" id="bride" name="bride" class="required"/>
<label for="groom">Groom</label>
<input type="text" id="groom" name="groom" class="required"/>
<label for="address">Address</label>
<input type="text" id="address" name="address" class="required"/>
<label for="ceremony">Ceremony Location</label>
<input type="text" id="ceremony" name="ceremony" class="required"/>
<label for="reception">Reception Location</label>
<input type="text" id="reception" name="reception" class="required"/>
<label for="message">Message</label>
<textarea id="message" name="message" cols="40" rows="2" class="required"></textarea>
<h3>Please enter code</h3>
<img src="captcha.php" id="captcha" alt="captcha"/>
<label for="security_code">Code</label>
<input type="text" id="security_code" name="security_code" autocomplete="off" class="required"/>
<button type="submit" id="send" name="send">Send!</button>
</fieldset>
</form>
<?php } ?>
Thanks for help if possible
Dave
Thanks
Dave