Hi,
TinyMCE is great. I would love if someone could just help me with this and then i'll be so happy.
Ok currently ive got a index.php which opens up a .html file and imports that html into the tinymce text box, there i can easily edit the html file and then click save.
When doing save in php i use the fwrite command to write the contents of the text box to the .html file.
The only problem is that when saving a the file it loves to add \'s throughout the saved file, which results in the file being abnormal.
Here is the original file,
http://westend.smokin.co.nz/HTMLFiles/about_us.html
Here is the file after its been saved with TinyMCE,
http://westend.smokin.co.nz/HTMLFiles/about_us_saved.html … saved.html
The part of the php file to do with saving is this;
if (is_writable($filename)) {
// In our example we're opening $filename in append mode.
// The file pointer is at the bottom of the file hence
// that's where $somecontent will go when we fwrite() it.
if (!$handle = fopen($filename, 'w')) {
echo "Cannot open file ($filename)";
exit;
}
// Write $somecontent to our opened file.
if (fwrite($handle, $somecontent) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
echo "File Saved! ($file)";
fclose($handle);
} else {
echo "The file $filename is not writable";
}