How to send form data to database with the help of PHP and SQL

<?php 
include"config.php";

if (isset($_POST ["submit"]))
{

$sql="insert into book_party(name,email,phone,date, message) values('".$_POST['name']."','".$_POST['email']."','".$_POST['phone']."','".$_POST['date']."' ,'".$_POST['message']."')";
mysql_query($sql);

echo $thanks="<font color='blue' size='5'>Thanks For Contactign us, We Will call you Shortly.</font>";
}
?>
<form class="" method="post"  action="index.php"  ><br>
<input type="text" name="name"  id="name" Placeholder="Name" required   /> <br>
<input type="text" name="email"  id="email" Placeholder="Email" required   /><br>
<input type="text" name="phone"  id="phone" Placeholder="Mobile" required   /><br>
Booking Date: 
<input type="date" name="date"  id="date" Placeholder="Email" required   /><br>

<textarea  name="message" id="message:" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'Requirements';}">message.. </textarea>
<div class="submit-btn"><br>

<input name="submit"id="submit "type="submit" value="submit"><input name="action"id="action "type="hidden" value="save">
</form>

Comments

Post a Comment

Popular posts from this blog

How to filter data from database according to client name & date wise in PHP

Captcha Code In PHP