Hey guys!
I am ripping all my hair out..... I cannot figure this one out.....
Here is the code... what is wrong.... It tells me an error on the last line...
Do u see anything
Parse error: parse error, unexpected $ in /home/content/b/r/a/brayden822/html/send_estimate.php on line 170 LAST LINE
Here is the code
<?
/* grabs the POST variables and puts them into variables that we can use */
$firstName=$_POST['firstName'];
$lastName=$_POST['lastName'];
$address=$_POST['address'];
$city=$_POST['city'];
$zip=$_POST['zip'];
$phone=$_POST['phone'];
$cphone=$_POST['cphone'];
$email=$_POST['email'];
$contact=$_POST['contact'];
$time=$_POST['time'];
$products=$_POST['products'];
$priority=$_POST['priority'];
$within=$_POST['within'];
$when=$_POST['when'];
$source=$_POST['source'];
//---------VALIDATION-------->
if($firstName){//----> CHECK input
}
else{
$error.="Please, go back and fill out your first name<br>\n";//----> ERROR if no input
}
if($lastName){//----> CHECK input
}
else{
$error.="Please, go back and fill out your last name<br>\n";//----> ERROR if no input
}
if($address){//----> CHECK input
}
else{
$error.="Please, go back and fill out your address<br>\n";//----> ERROR if no input
}
if($city){//----> CHECK input
}
else{
$error.="Please, go back and fill in your city<br>\n";//----> ERROR if no input
}
if($state){//----> CHECK input
}
else{
$error.="Please, go back and fill in your state<br>\n";//----> ERROR if no input
}
if($zip){//----> CHECK input
}
else{
$error.="Please, go back and fill in your zipcode<br>\n";//----> ERROR if no input
}
if($phone){//----> CHECK input
}
else{
$error.="Please, go back and input your home phone number<br>\n";//----> ERROR if no input
}
if($cphone){//----> CHECK input
}
else{
$error.="Please, go back and input your moble number<br>\n";//----> ERROR if no input
}
if($email){//----> CHECK input
}
else{
$error.="Please, go back and fill in you email address<br>\n";//----> ERROR if no input
}
if($contact){//----> CHECK input
}
else{
$error.="Please, go back and fill out how to contact you<br>\n";//----> ERROR if no input
}
if($time){//----> CHECK input
}
else{
$error.="Please, go back and fill in the best time for us to contact you<br>\n";//----> ERROR if no input
}
if($products){//----> CHECK input
}
else{
$error.="Please, go back and select your products of interest<br>\n";//----> ERROR if no input
}
if($priority){//----> CHECK input
}
else{
$error.="Please, go back and select the product that is a priority <br>\n";//----> ERROR if no input
}
if($within){//----> CHECK input
}
else{
$error.="Please, go back and select when you are looking at beginning your project<br>\n";//----> ERROR if no input
}
if($when){//----> CHECK input
}
else{
$error.="Please, go back and select when you would like QRG to contact you<br>\n";//----> ERROR if no input
}
if($source){//----> CHECK input
}
else{
$error.="Please, go back and select how you heard about QRG<br>\n";//----> ERROR if no input
}
if($comments){//----> CHECK input
}
else{
$error.="Please, go back and fill out the direct source if N/A, please enter N/A<br>\n";//----> ERROR if no input
}
//-------->ERROR FREE??
if($error==""){
echo "Thank you for inquiring about our FREE ESTIMATE! A receipt of your submission will be e-mailed to you almost immediately.";
//----------------------------------
$mailContent="--------CONTACT--------\n"
."First Name: ".$firstName."\n"
."Last Name: ".$lastName."\n"
."Address: ".$address."\n"
."City: ".$city."\n"
."State: ".$state."\n"
."Zipcode: ".$zip."\n"
."Home Phone: ".$phone."\n"
."Mobile Phone: ".$cphone."\n"
."E-mail: ".$email."\n"
."Contact Me Via: ".$contact."\n"
."Your can contact me at: ".$time."\n"
."I am interested in these products: ".$products."\n"
."My priority is: ".$priority."\n"
."I am looking to complete the project: ".$within."\n"
."QRG can contact me: ".$when."\n"
."I heard about QRG from a(an): ".$source."\n"
."The direct source is: ".$comments."\n";
//----------------------------------
$toAddress="Jay@theultimatedream.net";
$subject="Free Estimate";
$recipientSubject="Free Estimate Contact Form";
$receiptMessage = "Thank you ".$firstName." for inquiring about QRG's FREE ESTIMATE!\n\n\nHere is what you submitted to us:\n\n"
."--------CONTACT--------\n"
."First Name: ".$firstName."\n"
."Last Name: ".$lastName."\n"
."Address: ".$address."\n"
."City: ".$city."\n"
."State: ".$state."\n"
."Zipcode: ".$zip."\n"
."Home Phone: ".$phone."\n"
."Mobile Phone: ".$cphone."\n"
."E-mail: ".$email."\n"
."Contact Me Via: ".$contact."\n"
."Your can contact me at: ".$time."\n"
."I am interested in these products: ".$products."\n"
."My priority is: ".$priority."\n"
."I am looking to complete the project: ".$within."\n"
."QRG can contact me: ".$when."\n"
."I heard about QRG from a(an): ".$source."\n"
."The direct source is: ".$comments."\n";
//----------------------------------
mail($email, $subject, $receiptMessage,"From:$toAddress");
//----------------------------------
mail($toAddress,$recipientSubject,$mailContent,"From:$email");
//--->echo $mailContent;
?>
</body>
</html>
Thanks for the help.... I think the code is correct!
Brady