To use FCKeditor to edit full page html documents, I need to process forms with "savedata.php".
What does this file look like? I am not a programmer, so if someone has a sample I could simply copy, that would be great!
All I need is the file browser to open and edit .html documents, and uploader to insert images.
Can I open other .html files in a directory for editing? Or does each file need a TextArea? (I didn't see a button on the toolbar to open files in a directory.
Thanks in advance!
What does this file look like? I am not a programmer, so if someone has a sample I could simply copy, that would be great!
All I need is the file browser to open and edit .html documents, and uploader to insert images.
Can I open other .html files in a directory for editing? Or does each file need a TextArea? (I didn't see a button on the toolbar to open files in a directory.
Thanks in advance!
RE: savedata.php
I don't know if this is too late, but I'm sure it will help someone. I just set up FCKeditor and I had the same questions, same situation.
Here's how to import an html file into the editor using your main displayed php file:
And then to save the changes, here's the savedata.php:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html> <head> <title>My Page Updated!</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="robots" content="noindex, nofollow"> <link href="mainstyle.css" rel="stylesheet" type="text/css" /> </head> <body> <h1>mypage.html has been updated</h1> This page lists all data posted by the form. <hr> <table width="100%" border="1" cellspacing="0" bordercolor="#999999"> <tr style="FONT-WEIGHT: bold; COLOR: #dddddd; BACKGROUND-COLOR: #999999"> <td nowrap>Field Name </td> <td>Value</td> </tr> <?php if ( isset( $_POST ) ) $postArray = &$_POST ; // 4.1.0 or later, use $_POST else $postArray = &$HTTP_POST_VARS ; // prior to 4.1.0, use HTTP_POST_VARS foreach ( $postArray as $sForm => $value ) { $postedValue = htmlspecialchars( stripslashes( $value ) ) ; // Open the file for truncated writing $fp = @fopen("../UserFiles/File/mypage.html", "w") or die("Couldn't open file for writing!"); $numBytes = @fwrite($fp, $value) or die("Couldn't write html to file!"); @fclose($fp); echo "Wrote $numBytes bytes to file successfully!"; ?> <br/><br/> <tr> <td valign="top" nowrap><b><?=$sForm?></b></td> <td width="100%"><?=$postedValue?></td> </tr> <?php } ?> </table> <br/><br/> <div align="center"> <form action="0"> <input type="button" value="Close Window" onclick="window.close()"> </form> </div> </body> </html>
RE: savedata.php
...
$postedValue = htmlspecialchars( stripslashes( $value ) ) ;
//Add this line
$writeValue = stripslashes( $value ) ;
....
//Fix this line ($value is now $writeValue)
$numBytes = @fwrite($fp, $writeValue) or die("Couldn't write html to file!");