I am working to make html files of a website editable using CKEditor. I want the user should be able to edit the code of any html file via the admin panel. For this purpose I am using the file_get_contents function which seems to work fine except the JavaScript code is not displayed as editable code in the editor. I have tried the fread function as well and it also displays all the contents of the file in editor but I am still unable to get the JavaScript code in the editor as editable code. Any help?
Here's the code:
$contents = file_get_contents($_REQUEST['path']);
if(!$contents) die("Page not found");
$oFCKeditor = new FCKeditor('content') ;
$oFCKeditor->BasePath = 'fckeditor/' ;
$oFCKeditor->Width = '100%' ;
$oFCKeditor->Height = '350' ;
if($mode == 'edit')$oFCKeditor->Value = stripslashes($contents);
$oFCKeditor->Create() ;