Php form issue with spam filter maybe? Or drop-down?

Hi, I am getting an error in my form. It appears to be in the spam filter, but the code is the same I have used before several times, just field values changed. the only new addition is the drop-down field.
Here is the code in the HTML page:

<form name="dform" action="email.php" method="post" onsubmit="return formCheck(this);">
		<input type="hidden" value="[email protected]" name="email" />
		<input type="hidden" value="Wedding Inquiry Submission" name="subject"/>
		First Name:* <input type="text" name="first_name" style="width:320px; height:15px; overflow:hidden; background-color:#E6e6e6; size="10" />
		<p></p>Last Name:* <input type="text" name="last_name" style="width:320px; height:15px; overflow:hidden; background-color:#E6e6e6;" size="10" /> 
		<p></p>Phone:* <input type="text" name="phone" style="width:345px; height:15px; overflow:hidden; background-color:#E6e6e6;" />		
		<p></p>Email:* <input type="text" name="your_email" style="width:348px; height:15px;  overflow:hidden; background-color:#E6e6e6;" size="10" />
		<p></p>City:* <input type="text" name="city" style="width:250px; height:15px;  overflow:hidden; background-color:#E6e6e6;" size="10" />
		State:* <input type="text" name="state" style="width:52px; height:15px;  overflow:hidden; background-color:#E6e6e6;" size="10" />
		<p></p>Wedding Date:* <input type="text" name="wedding_date" style="width:301px; height:15px; overflow:hidden; background-color:#E6e6e6;" size="10" />
		<p></p>Desired Destination:* 
		<select name="desired_destination">
		<option value="puerta_vallarta" style="background-color:#E6e6e6;">Puerta Vallarta</option>
		<option value="riviera_maya" style="background-color:#E6e6e6;">Riviera Maya</option>
		<option value="san_miguel_allende" style="background-color:#E6e6e6;">San Miguel Allende</option>
		</select>
		<br /><img src="images/dream_wedding.png" alt="talk to us about your dream wedding" style="margin-top:2px; margin-bottom:2px" />
		<br /><textarea name="dream_wedding" style="width:400px; height:50px; background-color:#E6e6e6; font-family:verdana, sans-serif; overflow:hidden;" size="10" /></textarea>


		</p><p><div style="text-align:left"><input type="submit" value="submit" name="submit"/> &nbsp; *required fields</div>
		</form>

And here is the email.php code
[php]

<?php if(isset($_POST['submit'])) { # Form declarations $to = "[email protected]"; $subject = "Wedding Inquiry Submission"; $from = "Wedding Inquiry Submission"; $first_name_field = $_POST['first_name']; $last_name_field = $_POST['last_name']; $phone_field = $_POST['phone']; $your_email_field = $_POST['your_email']; $city_field = $_POST['city']; $state_field = $_POST['state']; $wedding_date_field = $_POST['wedding_date']; $desired_destination_field = $_POST['desired_destination']; $dream_wedding_field = $_POST['dream_wedding']; $body = " First Name: $first_name_field\n Last Name: $last_name_field\n Phone: $phone_field\n Email: $your_email_field\n City: $city_field\n State: $state_field\n Wedding Date: $wedding_date_field\n Desired Destination: $desired_destination_field\n Dream Wedding: $dream_wedding_field\n; $SpamErrorMessage = "No Websites URLs permitted"; if (preg_match("/http/i", "$first_name_field")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$last_name_field")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$phone_field")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$your_email_field")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$city_field")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$state_field")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$wedding_date_field")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$desired_destination_field")) {echo "$SpamErrorMessage"; exit();} if (preg_match("/http/i", "$dream_wedding_field")) {echo "$SpamErrorMessage"; exit();} $success = mail($to, $subject, $body, "From: \"$name_field\" <$your_email_field>"); } if ($success){ header('Location: http://bellami-designboutique.com/rb/thankyouemail.html'); } else { header('Location: http://bellami-designboutique.com/rb/emailerror.html'); } ?>

[/php]
The page is posted in a test environment at:
http://www.bellami-designboutique.com/rb/

Hi there,

If you copied the code from your script, then you are missing a double-quote after the Dream Wedding part of your message body which is going to Parse error you out. If there is a double-quote at the end of your message body, please tell us what exactly is the error you are getting (copy and paste the error message PHP is giving you) and post it here. You code looks fine with the exception of the missing double-quote after the Dream Wedding: $dream_wedding_field\n.

Thanks.

Thanks so much for catching that! but it still appears that it doesnt work. here is the error code I am getting:
Parse error: syntax error, unexpected T_VARIABLE in /data/13/1/134/101/1297590/user/1389030/htdocs/rb/email.php on line 30

My mistake - it IS working now. thank you!!!

Sponsor our Newsletter | Privacy Policy | Terms of Service