Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = "localhost";
- $username = "0000000";
- $password = "0000000";
- $db_name = "0000000";
- $con=mysql_connect("$host", "$username", "$password") or die("cannot connect"); // MySQL connection
- mysql_select_db("$db_name") or die("can not select DB"); // Select database
- $name = $_POST['name'];
- $mobile = $_POST['mobile'];
- $email = $_POST['email'];
- $message = $_POST['message'];
- $rdDomestic = $_POST['rdDomestic'];
- $fromCity = $_POST['fromCity'];
- $toCity = $_POST['toCity'];
- $dtDeparture = $_POST['dtDeparture'];
- $dtReturn = $_POST['dtReturn'];
- $cmbAdult = $_POST['cmbAdult'];
- $cmbChild = $_POST['cmbChild'];
- $cmbChild = $_POST['cmbChild'];
- $cmbInfants = $_POST['cmbInfants'];
- $rdClass = $_POST['rdClass'];
- $query = "INSERT INTO `insert_flight`(`F_Inq_ID`, `name`, `mobile`, `email`, `message`, `rdDomestic`, `fromCity`, `toCity`, `dtDeparture`, `dtReturn`, `cmbAdult`, `cmbChild`, `cmbInfants`, `rdClass`)
- VALUES ('', '$name', '$mobile', '$email', '$message', '$rdDomestic', '$fromCity', '$toCity', '$dtDeparture', '$dtReturn', '$cmbAdult', '$cmbChild', '$cmbInfants', '$rdClass')";
- mysql_query($query) or die('Query "' . $query . '" failed: ' . mysql_error());
- // Starting email sending data below //
- mysql_close($con);
- $header = "From: $emailn" . "Reply-To: $emailn";
- $subject = "New Flight Inquiry Received";
- $email_to = "0000000@gmail.com";
- $message = "Full Name: $namen"
- . "Mobile: $mobilen"
- . "Email: $emailn"
- . "message: $messagen"
- . "From City: $fromCityn"
- . "To City: $toCityn";
- mail($email_to, $subject, $message, $header);
- // End sending email data...
- if ($query) { ?>
- <script language="javascript" type="text/javascript">
- alert('Thank you!!!! We received your request. We will contact you shortly.');
- window.location = 'index.php';
- </script>
- <?php
- }
- else { ?>
- <script language="javascript" type="text/javascript">
- alert('Message failed. Please, 0000');
- window.location = 'index.php';
- </script>
- <?php
- }
- ?>
- $to = '0000000@gmail.com';
- $subject = 'New Flight Inquiry Received';
- $msg = '
- <html>
- <head>
- <title>User Details</title>
- <body>
- <table width="100%" border="0">
- <tr><td>Full Name</td><td>' . $name . '</td></tr>
- <tr><td>Mobile</td><td>' . $mobile . '</td></tr>
- <tr><td>Email</td><td>' . $email . '</td></tr>
- <tr><td>message</td><td>' . $message . '</td></tr>
- <tr><td>From City</td><td>' . $fromCity . '</td></tr>
- <tr><td>To City</td><td>' . $toCity . '</td></tr>
- </body>
- </html>';
- $from = 'MIME-Version: 1.0' . "rn";
- $from .= 'Content-type: text/html; charset=iso-8859-1' . "rn";
- $from .= 'From: info@abcd.com';
- mail($to, $subject, $msg, $from);
Add Comment
Please, Sign In to add comment