Uh.. Where do I start?
Okay, first one:
<form method="post" action"<?php $handle ?>">
<?php $handle ?> doenst do anything(you dont print it). This translates to:
<form method="post" action""> and you are missing "="-sign after action.
Action should be the scriptname where you want to send the information to be processed. I think you tried to send it to $handle which is filehandle for your textfile.
In this case you probably want to send it to the same script where you are sending from:
<form method="post" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>">
There was so much missing and Im more quicker to code than explain (and I'm tired) so heres(hopefully) the working script..
Before the script heres a few tips:
Learn how to process forms with PHP. Study $GET, $POST and other predefined variables.
Do the form processing at the beginning of the script.
<?php
$filename = '../txt/grad.txt';
$msg = '';
if (isset($_POST['FCKeditor1'])) {
// took out the is_writable bcos the next check will fail if it isnt
if (!$handle = fopen($filename, 'w')) {
$msg = "Cannot open file ($filename)";
} else {
if (fwrite($handle, $_POST['FCKeditor1']) === TRUE) {
$msg = "Cannot write to file ($filename)";
} else {
$msg = 'Wrote syccesfully to file ('.$filename.')';
$content = $_POST['FCKeditor1'];
fclose($handle);
}
}
}
// If $content is not yet set and $filename exists, retrieve the contents of the file
if (!isset($content) && file_exists($filename)) {
$content = file_get_contents($filename);
} else {
$content = '';
}
include('../includes/header.php');
include('../includes/sidebar.php');
<td id="main_content">
<span class="heading_text">TxTCmS Administration</span><br /> <br />
<?php
// Print status message if there is any.
if (!empty($msg)) {
echo '<strong>'.$msg.'</strong';
}
include("../FCKeditor/fckeditor.php"); ?>
<form method="post" action"<?php echo $_SERVER['SCRIPT_NAME'];?>">
<?php
$oFCKeditor = new FCKeditor('FCKeditor1') ;
$oFCKeditor->BasePath = '../FCKeditor/';
$oFCKeditor->Height = '350' ;
$oFCKeditor->Value = $content;
$oFCKeditor->Create() ;
?>
<input type="submit" name="submit" value="Save Page"></input>
</form></td>
</table>
<?php include('../includes/footer.php')?>