Hi,
I want to be able to load an external html file into FCKditor. I can save it fine, but I am having trouble getting the content loaded into the editor.
And... I am not getting any errors.
This is what I have so far....
HTML FILE
<html>
<head>
<title>Editor</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="/fck/fckeditor/fckeditor.js"></script>
</head>
<body>
[B][COLOR="red"]<?php
include "read01.php";
?>[/COLOR][/B]
<form action="save01.php" method="post" target="_blank">
<script type="text/javascript">
var oFCKeditor = new FCKeditor('FCKeditor1');
oFCKeditor.BasePath = "/fck/fckeditor/";
[COLOR="Red"][B]oFCKeditor.Value = $sValue;[/B][/COLOR]
oFCKeditor.Create();
</script>
<br>
<input value="Submit" type="submit">
</form>
</body>
</html>
PHP FILE
<?php
$filename = 'sample01.htm';
if (!$handle = fopen($filename, 'r')) {
echo "$sValue=File did not load.";
exit;
}
$sValue = file_get_contents ($filename);
//echo $sValue;
?>
The editor doesn't load because the "oFCKeditor.Value = $sValue;" line in the html is not returning the value correctly.
But, if I do it like this (oFCKeditor.Value = "Some plain old hard-coded text string")
It will load the text and display the editor.
So... I am not sure if I am passing the contents of the html file from the PHP file, into the html correctly.
Any help would be appreciated.