I am developing CMS kind of website where I am using rich text editor to edit text of templates and I am try to save edited content on text files. Its working fine but when large amount of data send for save then some paragraph contents are truncated. I am using ajax to send data into back-end.
This is my php code for writing into the file
<?php
$file = fopen("../include/banner.html","w+");
fwrite($file,$_POST['param']);
fclose($file);
?>
my ajax code
var editor_data = CKEDITOR.instances.banner.getData();
alert(editor_data);
var param = 'param=' + editor_data;
$.ajax( {
type: "POST",
url:'./php/banner.php',
dataType:'html',
data: param, });
Can anyone help me to provide solution for writing large amount of data into text files using php. If am enter jast 2-3 lines its working fine but when more than 20 lines its not working properly some contents are truncated.