- This topic is empty.
-
AuthorPosts
-
September 29, 2009 at 6:18 pm #26286
drdave
MemberHey 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.
Here is what is returned in the body of my email
Address: 222 El Monte Blvd
Message: testCode below
<?php
if(isset($_POST)){
$emailFrom = "[email protected]";
$emailTo = "[email protected]";
$subject = "Inquiry";$interest = strip_tags($_POST);
$name = strip_tags($_POST);
$city = strip_tags($_POST);
$phone = strip_tags($_POST);
$email = strip_tags($_POST);
$date = strip_tags($_POST);
$bride = strip_tags($_POST);
$groom = strip_tags($_POST);
$address = strip_tags($_POST);
$message = strip_tags(stripslashes($_POST));$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 == $_POST){
$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; ?>" 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
DaveSeptember 29, 2009 at 6:44 pm #64841drdave
Memberok I see I was missing a few periods in the $body field.
Thanks
Dave -
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.