Hi there! :)

I am currently creating a website that needs to be editable by the client and have been looking into free online WYSIWYG editors. I have been focusing on FCKeditor, but also looking into TinyMCE.

I managed to partly integrate FCKeditor - it saves the text, but doesn't display it at the start. I am not using it with a database, could that be why it's not working properly?

Any suggestions/comments (good or bad) on free online WYSIWYG editors avaliable?

- Thanks.

Recommended Answers

All 5 Replies

What exactly was the problem you're having with FCKEditor?

Of the open-source ones FCKEditor and TinyMCE seem to be the best for general development and Kupu is geared at Zope/Plone and that kind of stuff.

There are a few proprietary ones (a quick google will no-doubt find them) but I'd try the open ones first - you have nothing to lose that way and I'm sure one of them will do the job

Hi pty.

I've also tried out having a main page with a submit button that then sends the file name (as a hidden field) to the page with the editor and then putting it into a variable, but no result.

I'm using the JavaScript version of the editor and working in PHP. Should I be using the PHP version of the editor?

The pages and code is as follows:

Admin page (admin/index.php page)

in head:

<script type="text/javascript" src="/FCKeditor/fckeditor.js"></script>

in body:

<div id="content">
<form method="post" action="savefile.php">
<script type="text/javascript">
var oFCKeditor = new FCKeditor('FCKeditor1');
oFCKeditor.BasePath = "/FCKeditor/";
oFCKeditor.Value = "[B]<?php include('../test/test.html') ?>[/B]";
oFCKeditor.Create();
</script>
<input type="submit" value="Submit!" />
</form>
</div><!-- end content -->

Save File page (admin/savefile.php page)

<?php
$newContent = stripslashes($_POST['FCKeditor1']);
 
$fileLocation = "../test/test.html";
 
$fh = fopen($fileLocation, 'w') or die("Sorry, can't open file...");
 
$stringData = $newContent;
 
 
fwrite($fh, $stringData);
 
fclose($fh);
 
?>

Viewed page (test/index.php)

<div id="content"><?php include('test.html'); ?></div><!-- end content -->

Content file (test/test.html)

<h1>Welcome!</h1>
<p> Lorem ipsum dolor sit…</p>

Hi!
I have just worked out why it didn't work... the editor wants the code all on one line... strangely the output from the editor is not on one line... hmmm...

I also changed code for editor to:

<script type="text/javascript">
<?php 
print "var oFCKeditor = new FCKeditor('FCKeditor1');
  oFCKeditor.BasePath = '/FCKeditor/';
  oFCKeditor.Value = '";
  include('../test/test.html');
  print "';
  oFCKeditor.Create();"; ?>
</script>

Hi!
I have just worked out why it didn't work... the editor wants the code all on one line... strangely the output from the editor is not on one line... hmmm...

I also changed code for editor to:

<script type="text/javascript">
<?php 
print "var oFCKeditor = new FCKeditor('FCKeditor1');
  oFCKeditor.BasePath = '/FCKeditor/';
  oFCKeditor.Value = '";
  include('../test/test.html');
  print "';
  oFCKeditor.Create();"; ?>
</script>

Ah, nice one. I wouldn't have thought it'd cause a problem

But.. i do your example and show me a mistake....my code is:

<?php
$oFCKeditor = new FCKeditor('TextArea') ;
$oFCKeditor->BasePath = 'FCKEditor/';
$oFCKeditor->Width = '700' ;
$oFCKeditor->Height = '500' ;

// this is my mistake.. i want to include pag2.php in the textarea... please help me!!!:'(
$oFCKeditor->Value = '";
include('/templates/indexk.html');"';
$oFCKeditor->Create() ;

?>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.