How to use CKEditor using PHP?
Important Links
- VLE Insurance Process Flow
- RAP Registration Flow
- RAP and VLE INS POSP
- Life Insurance
- Life Insurance Renewal
- Motor Comprehensive
- Motor Third Party
- Personal Accident
- Fire and Allied Perils
- Health Insurance
- Pradhan Mantri Fasal Bima Yojana (PMFBY)
- NPS
- CSC Digipay Commission Chart
- HDFC Commission
- Axis Bank Commission
- UCO Bank Commission
- ICICI Bank Commission
- BOB Bank Commission
- BOI Bank Commission
- CBI Bank Commission
- LIFE INSURANCE RENEWAL HANDBOOK
- Difference Between CSC RAP Insurance And CSC VLE Insurance - Registration | Products | Commission
- LIC Commission
How to use CKEditor using PHP?
Hi friends,
In this post, we will learn how to use ckeditor in php. i explained simply how to use ckeditor in php step by step. Here you will learn how to use ckeditor in php form. This tutorial will give you simple example of how to add ckeditor in php code.
I will give you simple Example of how to use ckeditor with php.
So let's see bellow example:
config.php
$host = "localhost";
$user = "root";
$password = "";
$dbname = "demos";
$con = mysqli_connect($host, $user, $password,$dbname);
if (!$con) {
die("Connection failed: " . mysqli_connect_error());
}
?>
index.php
How to use CKEditor with PHP Example
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>How to use CKEditor with PHP Example - Nicesnippets.com</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/ckeditor/4.18.0/ckeditor.js" integrity="sha512-woYV6V3QV/oH8txWu19WqPPEtGu+dXM87N9YXP6ocsbCAH1Au9WDZ15cnk62n6/tVOmOo0rIYwx05raKdA4qyQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
</head>
<body>
<?php
include "config.php";
if(isset($_POST['submit'])){
$title = $_POST['title'];
$short_desc = $_POST['short_desc'];
$long_desc = $_POST['long_desc'];
if($title != ''){
mysqli_query($con, "INSERT INTO contents(title,short_desc,long_desc) VALUES('".$title."','".$short_desc."','".$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 CKEditor with PHP Example - Nicesnippets.com</h4>
</div>
<div class="card-body">
<form method='post' action=''>
<div class="mb-3">
<label for="Title"><strong>Title :</strong></label>
<input type="text" name="title" class="form-control">
</div>
<div class="mb-3">
<label for="Description"><strong>Short Description :</strong></label>
<textarea id='short_desc' name='short_desc' class="form-control"></textarea>
</div>
<div class="mb-3">
<label for="long_desc"><strong>Long Description :</strong></label>
<textarea id='long_desc' name='long_desc' ></textarea><br>
</div>
<div class="d-flex justify-content-center">
<input type="submit" name="submit" value="Submit" class="btn btn-success">
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- Script -->
<script type="text/javascript">
CKEDITOR.replace('long_desc',{
height: "200px"
});
</script>
</body>
</html>
Latest POst
- LPG Gas Subsidy Check by mobile number
- PMEGP Loan Aadhar Card Se
- E Shram Card Balance Check Number
- How to Migrate CentOS 7 to AlmaLinux 8
- How to Install WHM/cPanel in Almalinux?
- Install cPanel on Rocky Linux 9 Server
- How to Link Aadhaar with UAN
- How To Setup LVS (Linux Virtual Server) Load Balancer on Rocky Linux 8.5
- Setup Quick DNS Server On Rocky Linux 8.5 Using Dnsmasq
- How To Install Ruby on Rails with Mysql on Rocky Linux 8.5
Recent Updates
- LPG Gas Subsidy Check by mobile number
- PMEGP Loan Aadhar Card Se
- E Shram Card Balance Check Number
- How to Migrate CentOS 7 to AlmaLinux 8
- How to Install WHM/cPanel in Almalinux?
- Install cPanel on Rocky Linux 9 Server
- How to Link Aadhaar with UAN
- How To Setup LVS (Linux Virtual Server) Load Balancer on Rocky Linux 8.5
- Setup Quick DNS Server On Rocky Linux 8.5 Using Dnsmasq
- How To Install Ruby on Rails with Mysql on Rocky Linux 8.5
Haryana Goverment Schemes
- Old Age Samman Allowance
- Widow Pension Scheme
- Disability Pension Scheme
- Financial Assistance to Destitute Children Scheme
- Financial Assistance to Non School Going Disabled Children
- Allowance to Dwarfs
- Allowance to Eunuchs
- Rajiv Gandhi Pariwar Bima Yojna
- Post-Matric Scholarship
- Merit Cum Means
- Pre-Matric Scholarship
- About MMPSY
- MMPSY PPT
- MMPSY HINDI Manual
- MMPSY English Manual
- Premium Chart for PMMDY (Pension Plan)
- Parivar Pehchan Patra (PPP)
- Download Family ID
- PMSVANidhi Process Flow
- PM SVANidhi through CSCs
- About PMSYM
- PMSYM Morpho Setting
- PMSYM Creative & FAQ
- PMSYM Process Manual