I was wondering if anyone could help me trouble shoot the following php code that uses a mail function to send form data.
The error I am currently getting is:
My code is:Parse error: syntax error, unexpected T_STRING in processor.php on line 46
Code: Select all
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
session_start();
//Validation and handling if check box is equal to Yes
if( ($_SESSION['security_code']==$_POST['security_code']) && (!empty($_POST['security_code'])) && ($_POST['field_5']=="Yes") ) {
// Checkbox handling
$field_5_opts = $_POST['field_5'][0];
// Sender email is predefined as a hidden html field
$email = $_POST['field_6'];
// Message body
$message = $_POST['field_1'] . " " . $_POST['field_2'] . " says no to development at Turrella Reserve" . "
Email address: " . $_POST['field_3'] . "
This is what " . $_POST['field_1'] . " has to say:
" . $_POST['field_4'] . "
Check if you wish to receive updates on development progress: $field_5_opts";
//Mail function
mail("xyz@gmail.com,xyz@yahoo.com","No development at Turrella Reserve",$message,"From: $email");
include("confirm.html");
}
//Validation and handling if check box is not equal to Yes
elseif( ($_SESSION['security_code']==$_POST['security_code']) && (!empty($_POST['security_code'])) && ($_POST['field_5']!="Yes") ) {
// Checkbox handling
$field_5_opts = $_POST['field_5'][0];
// Sender email is predefined as a hidden html field
$email = $_POST['field_6'];
// Message body
$message = $_POST['field_1'] . " " . $_POST['field_2'] . " says no to development at Turrella Reserve" . "
Email address: " . $_POST['field_3'] . "
This is what " . $_POST['field_1'] . " has to say:
" . $_POST['field_4'] . ";
// Mail function
mail("xyz@gmail.com","No development at Turrella Reserve",$message,"From: $email");
include("confirm.html");
}
else {
echo "Invalid Captcha String.";
}
?>