<?php
//get data from form  
$startlocation = $_POST['startlocation'];
$endlocation = $_POST['endlocation'];
$name = $_POST['name'];
$email= $_POST['email'];
$address= $_POST['address'];
$number= $_POST['number'];
$message= $_POST['message'];
$to = "burhan.rent.a.car@gmail.com";
$subject = "Want a car for rent";
$txt ="Start Location = ". $startlocation . "\r\n End Location = ". $endlocation . "\r\n Name = ". $name .  "\r\n Email = " . $email . "\r\n Addres = ". $address ."\r\n Number = ". $number . "\r\n Message =" . $message;
$headers = "From: noreply@burhanrentacar.net" . "\r\n" ."CC: somebodyelse@example.com";
if($email!=NULL){
    mail($to,$subject,$txt,$headers);
}
//redirect
header("Location:thankyou.php");
?>

