Hello everyone, I'm new to php and to forums so please be gentle.
I'm trying to create my first form and php script for a website that will allow the user to send their info to me in an email. Then the user will get a response that their info was recieved.
I'm getting this error code:
Parse error: syntax error, unexpected $end in /home/tgoode/prospectingtrea sures/contactus.php on line 77
This is the php I have:
thank you in advance for the help
please help me get started in understanding
I'm trying to create my first form and php script for a website that will allow the user to send their info to me in an email. Then the user will get a response that their info was recieved.
I'm getting this error code:
Parse error: syntax error, unexpected $end in /home/tgoode/prospectingtrea sures/contactus.php on line 77
This is the php I have:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Underconstruction Page</title>
</head>
<body>
<?php
$to = $_REQUEST['sendto']; // are these 1st 2 varaible correct?
$from = $_REQUEST['email'];
$name = $_REQUEST['name'];
$address1 = $_REQUEST['address1'];
$address2 = $_REQUEST['address2'];
$city = $_REQUEST['city'];
$county = $_REQUEST['county'];
$state = $_REQUEST['state'];
$zip = $_REQUEST['zip'];
$phone = $_REQUEST['phone'];
$fax = $_REQUEST['fax'];
$webaddress = $_REQUEST['webaddress'];
$email = $_REQUEST['email'];
$messages = $_REQUEST['messages'];
$headers = "From: $from";
$subject = "Web Contact Data";
$fields = array();
$fields{"name"} = "name";
$fields{"address1"} = "address1";
$fields{"address2"} = "address2"; // not required
$fields{"city"} = "city";
$fields{"county"} = "county";
$fields{"state"} = "state";
$fields{"zip"} = "zip";
$fields{"phone"} = "phone"; // not required
$fields{"fax"} = "fax"; // not required
$fields{"webaddress"} = "webaddress";
$fields{"email"} = "email";
$fields{"messages"} = "messages"; // not required
[B]//what does this line do?[/B]
$body = "We have recieved the following information:\n\n"; foreach($fields as $a => $b) { $body .= sprintf("%20s: $s\n",$b,$_REQUEST[$a]);}
$headers2 = "From: prospectingtreasures.com";
$subject2 = "Thank you for contacting us";
$autoreply = "Thank you for contacting us " . name . ". You should here from us usally within 48 hours. If you have more questions or requests, please email us at prospectingtreasures@gmail.com/";
if($from =='') {print "You have not entered an email, please enter";}
else {
if($name == '') {print "You have not entered a name or company name, please go back and enter a name";}
else {
if($address1 == '') {print "You forgot to enter a street address, please go back and enter an address";}
else {
if($city == '') {print "You forgot to enter your city, please go back and enter your city";}
else {
if($county == '') {print "You forgot to enter your county, please go back and enter your county";}
else {
if($state == '') {print "You forgot to enter your state, please go back and enter your state";}
else {
if($zip == '') {print "you forgot to enter your zipcode, please go back and enter yor zipcode";}
else {
if($webaddress == '') {print " You forgot to give us your web address, please enter you web address";}
else {
if($email == '') {print "You have not entered an email address, please go back and enter your email address";}
$send = mail($to, $subject, $body, $headers);
$send2 = mail($from, $subject2, $autoreply, $headers2);
if($send)
{header( " Location: http://www.prospectingtreasures.com/tgoode/thankyou.php" );} [B]//what does this line do?[/B]
else
{print "We encountered an error sending your mail, please notify webmaster@YourCompany.com";}
[B]}//where is th open?
}//where is th open?[/B]}
//been lookin at this all day for missing brackets and comma and such, wondering if its something else?
?>
</body>
</html>
please help me get started in understanding
Comment