how to save data from html form to a database using php?

Today, We want to share with you php contact us form with database.In this post we will show you Creating simple PHP contact form, hear for php contact form send email we will give you demo and example for implement.In this post, we will learn about Create Contact Form And Send Email using PHP with an example.

PHP MySQL contact us form with validation using Bootstrap

Step 1: Create contactus table

contactus table

CREATE TABLE `contactus` (
  `id` int(10) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `message` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_date` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Step 2: DataBase Configuration File

config.php


Step 3: Create index.php

index.php




    PHP MySQL contact us form with validation using Bootstrap - www.pakainfo.com

    




PHP MySQL contact us form with validation using Bootstrap

PHP Contact Form

Step 4: Create data.php

data.php

query($sql);

if (!$success) {
    die("Couldn't enter data: ".$mysqli->error);
}

echo "Thank You For Contacting Us ";

$conn->close();

?>

I hope you get an idea about PHP Contact Form.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Comment