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>
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>
Thank you for your post. This is excellent information. It is amazing and wonderful to visit your site.
ReplyDeleteDot Net Course in Chennai | Asp.Net Training in Chennai
Best Selenium Training Institute in Chennai | Selenium Coaching Institute in Chennai
Software Testing Training in Chennai | Testing Courses in Chennai
Java Training Institute in Chennai | Core Java Training in Chennai | Java Course and Certification
PHP Course in Chennai | PHP Training Institute in Chennai
Hey Kamila Thanks for providing Great complement.
ReplyDelete