I am trying to get this form to work but at www.fusionoutside (dot)co(dot)uk/contact us I am experinced with html but not php Below is a script which is not forwarding an email <?php $Name = $_POST['Name']; $Lastnname = $_POST['Lastname']; $Title = $_POST['Title']; $Email = $_POST['Email']; $Phone = $_POST['Phone']; $Email = $_POST['Email']; $Enquiry = $_POST['Enquiry']; die ("Thank you for contacting us we will contact you soon!! "); { if(!$Email == "" && (!strstr($Email,"@") || !strstr($Email,"."))) { echo "<h2>Use Back - Enter valid e-mail</h2>\n"; $badinput = "<h2>Feedback was NOT submitted</h2>\n"; echo $badinput; die ("Go back! ! "); } if(empty($Name) || empty($Email)) { echo "<h2>Use Back - fill in all fields</h2>\n"; die ("Use back! ! "); } $todayis = date("l, F j, Y, g:i a") ; $notes = stripcslashes($notes); $message = " $todayis [EST] \n Name: $Name \n Last name: $Lastname \n Email: $Email \n Phone Number: $Phone \n Email: $Email \n Enquiry: $Enquiry \n "; $from = "From: "; mail("info@fusionoutside.co.uk", $subject, $message, $from); ?> I know the characters (name,last name are not matching) but it was just me changing things around trying to find a solution to no success YOUR INPUT WILL BE GREATLY APPRECIATED
I am doing everything ONLINE I am getting everything on a browser in fact here is a changed code : <?php $Name = $_POST['Name']; $Lastnname = $_POST['Lastname']; $Company = $_POST['Company']; $Title = $_POST['Title']; $Email = $_POST['Email']; $Telephone = $_POST['Telephone']; $Mobile = $_POST['Mobile']; $Event = $_POST['Event']; $Enquiry = $_POST['Enquiry']; die ("Thank you for contacting us we will contact you soon!! "); { if(!$Email == "" && (!strstr($Email,"@") || !strstr($Email,"."))) { echo "<h2>Use Back - Enter valid e-mail</h2>\n"; $badinput = "<h2>Feedback was NOT submitted</h2>\n"; echo $badinput; die ("Go back! ! "); } if(empty($Name) || empty($Email)) { echo "<h2>Use Back - fill in all fields</h2>\n"; die ("Use back! ! "); } $todayis = date("l, F j, Y, g:i a") ; $notes = stripcslashes($notes); $message = " $todayis [EST] \n Name: $Name \n Last name: $Lastname \n Company: $Company \n Title: $Title\n Email: $Email \n Telephone: $Telephone \n Mobile: $Mobile \n Enquiry: $Enquiry \n "; $from = "From: "; mail("info@fusionoutside.co.uk",$subject, $message, $from); ?> and here is the ERROR MESSAGE Parse error: syntax error, unexpected $end in \\NAS37ENT\domains\f\fusionoutside.co.uk\user\htdocs\form_process.php on line 56
Why do you put die ("Thank you for contacting us we will contact you soon!! "); { PHP: at the beginning of you code? It will stop executing right after this command. Move it to the end of your code, and delete the curly bracket. Then, it will no longer be an error.
<?php $Name = $_POST['Name']; $Lastnname = $_POST['Lastname']; $Company = $_POST['Company']; $Title = $_POST['Title']; $Email = $_POST['Email']; $Telephone = $_POST['Telephone']; $Mobile = $_POST['Mobile']; $Event = $_POST['Event']; $Enquiry = $_POST['Enquiry']; if(!$Email == "" && (!strstr($Email,"@") || !strstr($Email,"."))) { echo "<h2>Use Back - Enter valid e-mail</h2>\n"; $badinput = "<h2>Feedback was NOT submitted</h2>\n"; echo $badinput; die ("Go back! ! "); } if(empty($Name) || empty($Email)) { echo "<h2>Use Back - fill in all fields</h2>\n"; die ("Use back! ! "); } $todayis = date("l, F j, Y, g:i a") ; $notes = stripcslashes($notes); $message = " $todayis [EST] \n Name: $Name \n Last name: $Lastname \n Company: $Company \n Title: $Title\n Email: $Email \n Telephone: $Telephone \n Mobile: $Mobile \n Enquiry: $Enquiry \n "; $from = "From: "; mail("info@fusionoutside.co.uk",$subject, $message, $from); echo "Thank you for contacting us we will contact you soon!! "; ?>
Kindly copy the entire code in form_process.php file. Or atleast mark out the 56th line with Red Backcolor and post the code again. Zandigo is correct. This is a fact, you'll never get your email sent, until you move the die() function at the end of the code. But it seems, there are more errors. Because, the error you're getting is because of an unclosed bracket or inverted comma.