I'm having a problem with a form on a website.
This is the setup I currently have...
I have index.php with a form on it. Upon submission, it's supposed to email us the results of the form, then it proceeds to index2.php - After they submit page 2, it emails to us and proceeds that person to the final page - index3.php - After they submit Page 3, they're done!
On all 3 pages with the form fields (index.php, index2.php and index3.php), I have:
Page 1: <form method="post" action="submit.php"> - Emails to us and the proceeds the user to Page 2
Page 2: <form method="post" action="submit2.php"> - Emails to us and the proceeds the user to Page 2
Page 3: <form method="post" action="submit3.php"> - Emails to us and the proceeds the user to Page 2
Now, I have uploaded all files, and when I submit index.php, I get an error, that says: Parse error: syntax error, unexpected T_STRING in /home/elasticd/public_html/island/submit.php on line 7
Here is what the PHP file has inside of it:
<?
// PLEASE EDIT THE FIELDS BELOW TO CUSTOMER FOR DIFFERENT SITES:
$landing = "index2.php";
$to = "email@address.com;
$subject = "page one results";
// DO NOT EDIT BELOW
// Generate email headers:
$from = (!empty($_POST['email'])) ? ($_POST['email']) : $to; // send from customer email if provided
$headers = "From: " . $from . "\r\n" .
"Reply-To: " . $from . "\r\n" .
"X-Mailer: PHP/" . phpversion();
// Generate email message:
$message = "On " . date('l dS \of F Y h:i:s A') . " the following was submitted through " . $_SERVER['HTTP_HOST'] . "\r\n";
$message .= "-------------------------------------------------------------------------------------\r\n\r\n";
// Insert all submitted fields into message:
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
$message .= str_replace("_", " ", $key) . ": " . $val . "\r\n";
}
mail($to, $subject, $message, $headers); // send email
header("Location: http://" . $_SERVER['HTTP_HOST'] . "/" . $landing); // redirect to landing confirmation page
?>
What's the problem here? I've used this same setup for lots of different websites and never had this problem before. Does something look wrong?