on booking form need to sending email to me by php
Posted: Mon Oct 17, 2016 5:49 am
on booking form need to sending email to me by php
booking form and insert data in to mysql database working fine.
(for this i am using two files, eg. booking.html, bookingInsert.php)
on booking form need to sending email to me by php
(to know the data immediately in my email)
mysql Server version: 5.5.52
phpmyadmin Version information: 4.0.10.14
bookingform -html file pasted
insert -php file pasted
Thanks
R.Chandrasekar
Email: bimpexrcs@gmail.com
Skype: bimpexrcs
----------------
form -html file
-----------
-------------
insert -php file
---------
-------
booking form and insert data in to mysql database working fine.
(for this i am using two files, eg. booking.html, bookingInsert.php)
on booking form need to sending email to me by php
(to know the data immediately in my email)
mysql Server version: 5.5.52
phpmyadmin Version information: 4.0.10.14
bookingform -html file pasted
insert -php file pasted
Thanks
R.Chandrasekar
Email: bimpexrcs@gmail.com
Skype: bimpexrcs
----------------
form -html file
-----------
Code: Select all
<!DOCTYPE html>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<body>
<title>Booking</title>
<h3>Booking :</h3>
<form action="bookingInsert.php" method="POST" />
<p>Name: <input type="text" name="name" /></p>
<p>Mobile_Number: <input type="text" name="mobile" /></p>
<p>Email: <input type="text" name="email" /></p>
<p>Pickup_Place: <input type="text" name="pickup_place" /></p>
<p>Drop_Place: <input type="text" name="drop_place" /></p>
<p>Car_Type: <input type="text" name="car_type" /> (Indica Rs.15 per km/Tavera Rs.19 per km/Innova Rs.24 per km)</p>
<p>Pickup_Time: <input type="text" name="pickup_time" /></p>
<p>Drop_Time: <input type="text" name="drop_time" /></p>
<p>Message: <input type="text" name="message" /> (To Calculate the distance
use: Google Maps <a href="https://maps.google.co.in">https://maps.google.co.in</a>)</p>
<blockquote>
<blockquote>
<p> <input type="submit" value="Book" /></p>
</blockquote>
</blockquote>
</form>
</body>
</html>-------------
insert -php file
---------
Code: Select all
<?php
define('DB_NAME', 'xxxx');
define('DB_USER', 'xxxxx');
define('DB_PASS', 'xxxx');
define('DB_HOST', 'xxxx');
$link = mysql_connect(DB_HOST, DB_USER, DB_PASS);
if(!$link)
{
die('Could not connect to database: ' . mysql_error());
}
$db_select = mysql_select_db(DB_NAME);
if(!$db_select)
{
die('Can\'t use ' . DB_NAME . ': ' . mysql_error());
}
echo "Booking";
$name = $_POST['name'];
$mobile = $_POST['mobile'];
$email = $_POST['email'];
$pickup_place = $_POST['pickup_place'];
$drop_place = $_POST['drop_place'];
$car_type = $_POST['car_type'];
$pickup_time = $_POST['pickup_time'];
$drop_time = $_POST['drop_time'];
$message = $_POST['message'];
$query = "INSERT INTO booking (name, mobile, email, pickup_place, drop_place, car_type, pickup_time, drop_time, message) VALUES ('$name', '$mobile', '$email', '$pickup_place', '$drop_place', '$car_type', '$pickup_time', '$drop_time', '$message')";
if(!mysql_query($query))
{
die("your data is incorrect try again");
}
else{ echo "Success"; }
mysql_close();
?>