Hero
─║╣ero─
- Reaction score
- 250
Hey everyone I'm still learning PHP but I designed a script and I am getting an error.
Any help?
The error says:
Here's the code:
Any help is appreciated.
Any help?
The error says:
Code:
Parse error: parse error, unexpected $ in hsscontact.php on line 61
Here's the code:
PHP:
<?php
$sendto = '[email protected]';
$from = $_REQUEST['Email'] ;
$name = $_REQUEST['Name'] ;
$address = $_REQUEST['Address'];
$city = $_REQUEST['City'];
$state = $_REQUEST['State'];
$zip = $_REQUEST['ZipCode'];
$homephone = $_REQUEST['HomePhone'];
$homeowner = $_REQUEST['HomeOwner'];
$headers = "From: $from";
$subject = "Alarm Application Contact Form";
$fields = array();
$fields{"FirstName"} = "First Name";
$fields{"LastName"} = "Last Name";
$fields{"Address"} = "Address";
$fields{"City"} = "City";
$fields{"State"} = "State";
$fields{"ZipCode"} = "ZipCode";
$fields{"HomePhone"} = "Home Phone";
$fields{"SecondaryPhone"} = "Secondary Phone";
$fields{"SpouseName"} = "Spouse's Name";
$fields{"HomeOwner"} = "Home Owner";
$fields{"Email"} = "Email";
$fields{"Agent_Referral"} = "Agent Referral";
$body = "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }
$headers2 = "From: [email protected]";
$subject2 = "Thank you for contacting us";
$autoreply = "Thank you for contacting us. Somebody will get back to you as soon as possible, usualy within 48 hours. If you have any more questions, please consult our website at www.financialfreedomus.com/alarm";
if($from == '') {print "You have not entered an email, please go back and try again";}
else {
if($name == '') {print "You have not entered a name, please go back and try again";}
else {
if($address == '') {print "You have not entered a address, please go back and try again";}
else {
if($city == '') {print "You have not entered a city, please go back and try again";}
else {
if($state == '') {print "You have not entered a state, please go back and try again";}
else {
if($zip == '') {print "You have not entered a zip code, please go back and try again";}
else {
if($homephone == '') {print "You have not entered a home phone, please go back and try again";}
else {
if($homeowner == '') {print "You have not selected whether or not if you are a home owner, please go back and try again";}
else {
$send = mail($sendto, $subject, $body, $headers);
$send2 = mail($from, $subject2, $autoreply, $headers2);
if($send)
{header( "Location: http://www.financialfreedomus.com/alarm" );}
else
{print "We encountered an error sending your mail, please notify [email protected]"; }
}
}
?>
Any help is appreciated.