The forum operates in read-only mode. Please head to StackOverflow for support.
<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> <?php include "read01.php"; $sValue= '"' . preg_replace("/[\r\n]+/",'" + $0"',addslashes($sValue)) . '"'; ?> <form action="save01.php" method="post" target="_blank"> <script type="text/javascript"> var oFCKeditor = new FCKeditor('FCKeditor1'); oFCKeditor.BasePath = "/fck/fckeditor/"; <?php echo "oFCKeditor.Value = $sValue"; ?> oFCKeditor.Create(); </script> <br> <input value="Submit" type="submit"> </form> </body> </html>
<?php $filename = 'sample01.htm'; if (!$handle = fopen($filename, 'r')) { echo "$sValue=File did not load."; exit; } $sValue = file_get_contents ($filename); ?>
<?php $sValue = stripslashes( $_POST['FCKeditor1'] ) ; $myFileName = "sample01.htm"; $fp = fopen ("$myFileName", "w+"); if(fwrite($fp, $sValue)) echo $sValue; else echo "$sValue=ERROR - NOT SAVED!"; fclose($fp); ?>
<p>This is <strong>some</strong> of <span style="font-size: x-large"><span style=""><strong><span style="color: #ff0000">our text</span></strong></span></span></p>
Re: Basic Load and Saving of Html Data
Re: Basic Load and Saving of Html Data
EDIT01.HTM (this is where the editor is inserted)
<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> <?php include "read01.php"; $sValue= '"' . preg_replace("/[\r\n]+/",'" + $0"',addslashes($sValue)) . '"'; ?> <form action="save01.php" method="post" target="_blank"> <script type="text/javascript"> var oFCKeditor = new FCKeditor('FCKeditor1'); oFCKeditor.BasePath = "/fck/fckeditor/"; <?php echo "oFCKeditor.Value = $sValue"; ?> oFCKeditor.Create(); </script> <br> <input value="Submit" type="submit"> </form> </body> </html>READ01.PHP (file that reads the sample01.htm file)
<?php $filename = 'sample01.htm'; if (!$handle = fopen($filename, 'r')) { echo "$sValue=File did not load."; exit; } $sValue = file_get_contents ($filename); ?>SAVE01.PHP (file that saves the FCKE text)
<?php $sValue = stripslashes( $_POST['FCKeditor1'] ) ; $myFileName = "sample01.htm"; $fp = fopen ("$myFileName", "w+"); if(fwrite($fp, $sValue)) echo $sValue; else echo "$sValue=ERROR - NOT SAVED!"; fclose($fp); ?>SAMPLE01.HTM (Test output that is loaded and saved in FCKE)
Re: Basic Load and Saving of Html Data [RESOLVED]
<html dir="ltr">
how can i save normal html page?
when i use your files it seems ok but when i use my html file to edit FCK doesnt even work properly?