How to use Summernote Editor in PHP?

Apr 06, 2022 . Admin

Hello dev,

I am going to explain you how to use summernote editor in php step by step. You will learn how to use summernote editor in php form.

This article will give you simple example of how to apply summernote editor in php. We will use get simple how to add summernote editor in php code.

I will give you simple Example of how to use summernote editor with php.

So, let's see bellow solution:

    $host = "localhost";
    $user = "root";
    $password = "";
    $dbname = "demos";
    $con = mysqli_connect($host, $user, $password,$dbname);

    if (!$con) {
        die("Connection failed: " . mysqli_connect_error());
<!DOCTYPE html>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>How to use Summernote Editor in PHP? -</title>
    <link rel="stylesheet" href="//" />
    <!-- include summernote css-->
    <link rel="stylesheet" href="" />
    <script src=""></script>
    <!-- include summernote js-->
    <script src=""></script>
        include "config.php";

            $title = $_POST['title'];
            $long_desc = $_POST['long_desc'];

            if($title != ''){
                mysqli_query($con, "INSERT INTO contents(title,long_desc) VALUES('".$title."','".$long_desc."') ");
                header('location: index.php');
    <div class="container mt-4">
        <div class="row">
            <div class="col-md-12">
                <div class="card">
                    <div class="card-header text-center bg-primary text-white">
                        <h4>How to use Summernote Editor in PHP? -</h4>
                    <div class="card-body">
                        <form method='post' action=''>
                            <div class="mb-3">
                                <label><strong>Title :</strong></label>
                                <input type="text" name="title" class="form-control">
                            <div class="mb-1">
                                <label><strong>Long Description :</strong></label>
                                <textarea id='makeMeSummernote' name='long_desc' class="form-control"></textarea><br>
                            <div class="d-flex justify-content-center">
                                <input type="submit" name="submit" value="Submit" class="btn btn-success">

    <!-- Script -->
    <script type="text/javascript">

It will help you...