hi,
i have a small CMS and want to try the FCKeditor for andminitration. i used the SPAW editor for now but experinced some problems with this editor.
now i try to integrate the FCKeditor and need some help with this. here is my code:
<form action="index.php?content=admin&action=<?php echo $action; ?>&catid=<?php echo $_REQUEST['catid'];?>&belongsto=<?php echo $_REQUEST['belongsto'];?>&baseid=<?php echo $_REQUEST['baseid'];?>&prisort=<?php echo $_REQUEST['prisort'];?>" method="POST">
<table cellspacing="0" cellpadding="0" border="0" width="500">
<tr>
<td width="40%">Link:</td>
<td><input type="text" name="link_text" style="width:300;" value="<?php echo $HTTP_POST_VARS['link_text']; ?>"></td>
</tr>
<tr>
<td width="40%">Titel:</td>
<td><input type="text" name="subject" style="width:300;" value="<?php echo $HTTP_POST_VARS['subject']; ?>"></td>
</tr>
<tr>
<td width="40%"> </td>
<td> <div align="right">
<input name="submit" type="submit" value="Speichern">
</div></td>
</tr>
<tr>
<td colspan="2" align="right"><div align="left">
<?php
include 'spaw/spaw_control.class.php';
$sw = new SPAW_Wysiwyg('description' /*name*/,stripslashes($HTTP_POST_VARS['description']) /*value*/,
'en' /*language*/, 'full' /*toolbar mode*/, 'default' /*theme*/,
'600px' /*width*/, '600px' /*height*/);
$sw->show();
?>
</div></td>
</tr>
</table>
</form>
The FCK editor works on the page but i can not submit data to mysql. i replace the spaw code with this one:
<script language="javascript">
<!--
var oFCKeditor ;
oFCKeditor = new FCKeditor('EditorDefault') ;
oFCKeditor.BasePath = '/php/admin/FCKeditor/' ; // '/FCKeditor/' is the default value so this line could be deleted.
oFCKeditor.Value = '<?php echo $HTTP_POST_VARS['subject']; ?>' ;
oFCKeditor.Config['StyleNames'] = ';Style 1;Style 2; Style 3' ;
oFCKeditor.Config['ToolbarFontNames'] = ';Arial;Courier New;Times New Roman;Verdana' ;
oFCKeditor.Create() ;
//-->
</script>
thanks for any help
RE: store to mysql
oFCKeditor = new FCKeditor('EditorDefault') ;
You have to write:
oFCKeditor = new FCKeditor('subject') ;
RE: store to mysql
ok! thanks, this worked.
but i have the next problem:
if i write:
oFCKeditor.Value = '<?php echo $HTTP_POST_VARS['subject']; ?>' ;
it gets the value from the database, if i write
oFCKeditor.Value = '<?php echo $HTTP_POST_VARS['description']; ?>' ;
the editor will not show up anymore...
i can write whatever i want as far i dont use 'description'
why?
RE: store to mysql