Is it possible to configure the editor to load the contents of an htm file on startup? So, instead of passing in a string of text when I initialize the editor, I'd like to pass in a filename. Is this possible?
Thu, 02/28/2008 - 15:04
#1

Re: setting a default document
<?php include("FCKeditor/fckeditor.php") ; // ***************************** $sValue = stripslashes( $_POST['FCKeditor1'] ) ; $action = $_REQUEST['sent']; $filename = "promotions-en.txt"; //Edit this to point to ur textfile $handle = fopen($filename, "rb"); fclose($handle); if ($action=="sent"){ $fh = fopen($filename, 'w') or die("Can't Access the file at this moment."); $stringData = $sValue; fwrite($fh, $stringData); fclose($fh); $saved = "<p>Your file has been saved</p>"; } ?> <?php echo $saved ?> <form action="<?php $_SERVER['HTTP_REFERER']; ?>" method="post"> <?php $content = file_get_contents("promotions-en.txt"); $oFCKeditor = new FCKeditor('FCKeditor1') ; $oFCKeditor->BasePath = 'FCKeditor/'; $oFCKeditor->Value = $content; $oFCKeditor->Width = '100%'; $oFCKeditor->Height = '490'; $oFCKeditor->Create() ; ?> <br> <input type="hidden" name="sent" id="sent" value="sent" /> <p style="text-align:center;"><input type="submit" value="Save Page"></p> </form>