<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>



	
	<?php



/* Code by David McKeown - craftedbydavid.com */

/* Editable entries are bellow */



$send_to = "giocondoindia@gmail.com";

$send_subject = "Table Reservation ";





/*Be careful when editing below this line */
$fields = array('name' =>'Name', 'email' => 'Email', 'date' => 'Date', 'time' => 'Time', 'guests' => 'Guests');


$f_name = cleanupentries($_POST["name"]);

$f_email = cleanupentries($_POST["email"]);

$f_date = cleanupentries($_POST["date"]);

$f_time = cleanupentries($_POST["time"]);
$f_guests = cleanupentries($_POST["guests"]);


$from_ip = $_SERVER['REMOTE_ADDR'];

$from_browser = $_SERVER['HTTP_USER_AGENT'];



function cleanupentries($entry) {

    $entry = trim($entry);

    $entry = stripslashes($entry);

    $entry = htmlspecialchars($entry);



    return $entry;

}



$message = "This email was submitted on " . date('m-d-Y') . 

"\n\nName: " . $f_name .

"\n\nE-Mail: " . $f_email . 

"\n\nDate: " . $f_date . 

"\n\nTime: \n" . $f_time . 
	
"\n\nGuests: \n" . $f_gues . 
	

"\n\n\nTechnical Details:\n" . $from_ip . "\n" . $from_browser;



$send_subject .= " - {$f_name}";



$headers = "From: " . $f_email . "\r\n" .

    "Reply-To: " . $f_email . "\r\n" .

    "X-Mailer: PHP/" . phpversion();



if (!$f_email) {

    echo "no email";

    exit;

}else if (!$f_name){

    echo "no name";

    exit;

}else if (!$f_phone){

    echo "no phone";

    exit;

}else{

    if (filter_var($f_email, FILTER_VALIDATE_EMAIL)) {

        mail($send_to, $send_subject, $message, $headers);

        echo "true";

    }else{

        echo "invalid email";

        exit;

    }

}



?>



</body>
</html>