Kristo
Website & Software Developer
- Feb 5, 2015
- 269
- 69
Hi,
When I submit a PHP form on my website I am getting an error on the web browser 'HTTP Error 500' can somebody help?
The following error code appears in my logs and I am not sure what is wrong as I am very new to PHP.
When I submit a PHP form on my website I am getting an error on the web browser 'HTTP Error 500' can somebody help?
Code:
<?php
if(empty($_POST['submit']))
{
echo "Form is not submitted!";
exit;
}
if(empty($_POST["fullname"]) ||
($_POST["email"])
empty($_POST["phone"])
empty($_POST["organisationname"])
empty($_POST["address"])
empty($_POST["hiredate"])
empty($_POST["destination"])
empty($_POST["passengercount"]))
{
echo "Please fill the form";
exit;
}
$name = $_POST["fullname"];
$email = $_POST["email"];
$tel = $_POST["tel"];
$organisationname = $_POST["organisationname"];
$address = $_POST["address"];
$hire = $_POST["hiredate"];
$destination = $_POST["destination"];
$passengercount = $_POST["passengercount"];
mail( '[email protected]' , 'Vehicle Hire Form Submission' ,
"New form submission: Name: $name, Email: $email, Telephone: $tel, Organisation Name: $organisationname, Address: $address, Hire Date: $hiredate, Destination: $destination, Number of Passengers: $passengercount" );
header('Location: thank-you.html');
?>
The following error code appears in my logs and I am not sure what is wrong as I am very new to PHP.
[20-Nov-2017 13:39:22 UTC] PHP Parse error: syntax error, unexpected 'empty' (T_EMPTY) in /home/public_html/hire-form-proc.php on line 10
[20-Nov-2017 14:10:06 UTC] PHP Parse error: syntax error, unexpected 'empty' (T_EMPTY) in /home/public_html/hire-form-proc.php on line 10
[20-Nov-2017 14:12:55 UTC] PHP Parse error: syntax error, unexpected '(' in /home/public_html/hire-form-proc.php on line 10