Hi, im starting in php and I wanted to know how can I write a text using FCKEditor and then save it content to a .txt file on serverside. Somebody can help me write the php code to do this.
Here is the beta code:
-----------------------------------------------------writer.php---------------------------------------------
<?php
include_once("fckeditor/fckeditor.php") ;
?>
<html>
<head>
<title>FCKeditor - Sample</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<form action="writetofile.php" method="post" target="_blank">
<?php
$oFCKeditor = new FCKeditor('FCKeditor1') ;
$oFCKeditor->BasePath = '/fckeditor/' ;
$oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
$oFCKeditor->Create() ;
?>
<br>
<input type="submit" value="Submit">
</form>
</body>
</html>
---------------------------------------EOF-----------------------------------------------
---------------------------writetofile.php-------------------------------------------
<?php
$myFile = "testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $Submit; ?????????????????????????? <- I think this code is wrong!
fwrite($fh, $stringData);
fclose($fh);
>?
-------------------------------------------------------------EOF--------------------------------------------
Thanks 4 the help.
Mon, 05/26/2008 - 22:53
#1