AJAX HTML Javascript jQuery PHP Example MORE Videos New

How to send CKeditor data to PHP file using AJAX, jQuery


index.php

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.ckeditor.com/4.15.0/standard/ckeditor.js"></script>
<script>
$(document).ready(function(){
  $("#save").click(function(){
    var Content = CKEDITOR.instances['Content'].getData();
            $.ajax({
url: "save.php",
type: "POST",
data: {
Content: Content
},
cache: false,
success: function(dataResult){
var dataResult = JSON.parse(dataResult);
if(dataResult.statusCode==200){

$('#success').html('Data Saved successfully !');
}
else if(dataResult.statusCode==201){
  alert("Error occured !");
}

}
});
  });
  CKEDITOR.replace('Content');
});
</script>
</head>
<body>
<textarea name="Content" id="Content" placeholder="Required, at least 4 characters"></textarea><br>
<button type="button" id="save">Save</button>
</body>
</html>

save.php

<?php
echo $_POST['Content'];
?>

  

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, bool given in /www/wwwroot/studentstutorial.com/includes/get_article.php on line 13