Code: Select all
<?php
$con = mysql_connect("dbname","dbusername","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("db428287159", $con);
$sql="INSERT INTO customer (terms, firstname, lastname, phone, email, notify, specialneeds, eugenetopdx, pdxtoeugene, pickupdropoff, salemtopdx, pdxtosalem, albanytopdx, pdxtoalbany, departuredate, departuretime, returndate, adults, seniorsstudents, children, luggage, paymentmethod, date_and_time, fare)
VALUES
('$_POST[terms]','$_POST[firstname]','$_POST[lastname]','$_POST[phone]','$_POST[email]','$_POST[notify]','$_POST[specialneeds]','$_POST[eugenetopdx]','$_POST[pdxtoeugene]','$_POST[pickupdropoff]','$_POST[salemtopdx]','$_POST[pdxtosalem]','$_POST[albanytopdx]','$_POST[pdxtoalbany]','$_POST[departuredate]','$_POST[departuretime]','$_POST[returndate]','$_POST[adults]','$_POST[seniorsstudents]','$_POST[children]','$_POST[luggage]','$_POST[paymentmethod]','$_POST[date_and_time]','$_POST[fare]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
mysql_close($con);
$mailto="admin@somecompany.com,$_POST[email]";
$firstname = $_REQUEST['firstname'];
$lastname = $_REQUEST['lastname'];
$phone = $_REQUEST['phone'];
$departuredate = $_REQUEST['departuredate'];
$subject = "Reservation Confirmation";
$message = "
First Name: $firstname
Last Name: $lastname
Phone: $phone\n\nThis is to confirm your reservation for $departuredate\n Please be at your pickup location at least 10 minutes in advance.\n\n Thank you"
; $headers = "From: admin@somecompany.com\r\n" . "MIME-Version: 1.0\r\n" . "Content-type: text/plain; charset=iso-8859-1\r\n" . "X-Priority: 3\r\n" . "X-Mailer: PHP". phpversion() ."\r\n" ;
mail("$mailto" , "$subject" , "$message" , "$headers");
header('Location: payment2.html');
?>