PHP booking form Query
Posted: Sat Mar 28, 2009 1:07 pm
Hey Guys
I am new to php and recently i sat and wrote a code for my fathers website.. It is a booking form and the code that i wrote send me random blank emails... so there must be something up with the code... the code is:
<?php
/* Subject and email variables */
$emailSubject = 'Booking Form';
$webMaster = 'info@lecltd.net';
/* Gathering Data Variables */
$NameField = $_POST['nameField'];
$MobileField = $_POST['telephone'];
$EmailField = $_POST['email'];
$PickupField = $_POST['pickAdd'];
$DropoffField = $_POST['dropAdd'];
$OutdateField = $_POST['outDate'];
$OuttimeField = $_POST['outTime'];
$OutflightField = $_POST['outFlight'];
$OutpassengersField = $_POST['outPassengers'];
$OutLuggageField = $_POST['outLuggage'];
$indateField = $_POST['inDate'];
$intimeField = $_POST['inTime'];
$inflightField = $_POST['inFlight'];
$inpassengersField = $_POST['inPassengers'];
$inLuggageField = $_POST['inLuggage'];
$body = <<<EOD
<br><hr><br>
Name: $nameField <br>
Phone Number: $MobileField <br>
Email: $EmailField <br>
Pick up Address: $PickupField <br>
Drop Off Address: $DropoffField <br>
Outward Date: $OutdateField <br>
Outward Time: $OuttimeField <br>
Outward Flight no: $OutflightField <br>
Outward Passengers: $OutpassengersField <br>
Outward luggage: $OutLuggageField <br>
Inward Date: $indateField <br>
Inward Time: $intimeField <br>
Inward Flight no: $inflightField <br>
Inward Passengers: $inpassengersField <br>
Inward luggage: $inLuggageField <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: tect/hmtl\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);
if($success){
echo "Thankyou, We will contact you shortly";
}
else{
echo "Error Please contact us through our contact page, Thank You";
}
?>
I do not undrrstand what i could hve done wrong.. maybe you guys got point me in the right direction...
thanks
Evan
I am new to php and recently i sat and wrote a code for my fathers website.. It is a booking form and the code that i wrote send me random blank emails... so there must be something up with the code... the code is:
<?php
/* Subject and email variables */
$emailSubject = 'Booking Form';
$webMaster = 'info@lecltd.net';
/* Gathering Data Variables */
$NameField = $_POST['nameField'];
$MobileField = $_POST['telephone'];
$EmailField = $_POST['email'];
$PickupField = $_POST['pickAdd'];
$DropoffField = $_POST['dropAdd'];
$OutdateField = $_POST['outDate'];
$OuttimeField = $_POST['outTime'];
$OutflightField = $_POST['outFlight'];
$OutpassengersField = $_POST['outPassengers'];
$OutLuggageField = $_POST['outLuggage'];
$indateField = $_POST['inDate'];
$intimeField = $_POST['inTime'];
$inflightField = $_POST['inFlight'];
$inpassengersField = $_POST['inPassengers'];
$inLuggageField = $_POST['inLuggage'];
$body = <<<EOD
<br><hr><br>
Name: $nameField <br>
Phone Number: $MobileField <br>
Email: $EmailField <br>
Pick up Address: $PickupField <br>
Drop Off Address: $DropoffField <br>
Outward Date: $OutdateField <br>
Outward Time: $OuttimeField <br>
Outward Flight no: $OutflightField <br>
Outward Passengers: $OutpassengersField <br>
Outward luggage: $OutLuggageField <br>
Inward Date: $indateField <br>
Inward Time: $intimeField <br>
Inward Flight no: $inflightField <br>
Inward Passengers: $inpassengersField <br>
Inward luggage: $inLuggageField <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: tect/hmtl\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);
if($success){
echo "Thankyou, We will contact you shortly";
}
else{
echo "Error Please contact us through our contact page, Thank You";
}
?>
I do not undrrstand what i could hve done wrong.. maybe you guys got point me in the right direction...
thanks
Evan