Click to See Complete Forum and Search --> : Php Fck


markandkelle
10-30-2007, 10:04 AM
Hi, I have a php script that I am using to post articles on my website, the script to post them is as follows

<b>Post</b>
<form action="?<?php print $_SERVER['QUERY_STRING']; ?>" method="post">
<p>
Title:<br>
<input name="title" size="40"><br>
Content:<br>
<textarea cols="80" name="content" rows="24"></textarea><br><br>
<input checked name="html" type="checkbox"> Allow HTML?<br><br>
<input type="submit" value="Post">
</p>
</form>


I am trying to integrate FCK using this URLhttp://wiki.fckeditor.net/Developer%27s_Guide/Integration/PHP so that I can edit text add pictures etc in the form, but I really can not figure out how to do it?

Can anyone help please and guide me on how I add it to my form :-)

markandkelle
10-30-2007, 10:18 AM
<b>Post</b>
<?php
include("FCKeditor/fckeditor.php") ;
?>
<form action="?<?php print $_SERVER['QUERY_STRING']; ?>" method="post">
<p>
Title:<br>
<input name="title" size="40"><br>
<br>


<?php
$oFCKeditor = new FCKeditor('FCKeditor1') ;
$sValue = stripslashes( $_POST['content'] ) ;
$oFCKeditor->BasePath = '/mywebsite/FCKeditor/';
$oFCKeditor->Value = 'Default text in editor';
$oFCKeditor->Create() ;
?>
<input checked name="html" type="checkbox"> Allow HTML?<br><br>
<input type="submit" value="Post">
</p>
</form>


So I tried this, but that doesent seem to work? I am really shooting in the dark here, any ideas please?

markandkelle
10-30-2007, 10:28 AM
I DID IT! silly me!

markandkelle
10-30-2007, 10:56 AM
Ok so the prob was that I did not have this in there

<b>Post</b>
<?php
include("FCKeditor/fckeditor.php") ;
?>
<form action="?<?php print $_SERVER['QUERY_STRING']; ?>" method="post">
<p>
Title:<br>
<input name="title" size="40"><br>
<br>


<?php
$oFCKeditor = new FCKeditor('FCKeditor1') ; should say content not fckeditor
$sValue = stripslashes( $_POST['content'] ) ;
$oFCKeditor->BasePath = '/mywebsite/FCKeditor/';
$oFCKeditor->Value = 'Default text in editor';
$oFCKeditor->Create() ;
?>
<input checked name="html" type="checkbox"> Allow HTML?<br><br>
<input type="submit" value="Post">
</p>
</form>
I am now createing a form to edit the article but can not get it to work, any idea what I need to add to make it work? I am sure I just have a small error here, please help

<b>Edit article</b>
<?php
include("FCKeditor/fckeditor.php") ;
?>
<form action="?<?php print str_replace('&', '&amp;', $_SERVER['QUERY_STRING']);
?>" method="post">
<p>
Title:<br>
<input name="title" size="40" value="<?php print $edit_title_sava;
?>"><br>
Content:<br>
<?php
$oFCKeditor = new FCKeditor('content') ;
$sValue = stripslashes( $_edit['content'] ) ;
$oFCKeditor->BasePath = '/mywebsite/FCKeditor/';
$oFCKeditor->Value = $edit_content_sava;
$oFCKeditor->Create() ;
?><br><br>
<input checked name="html" type="checkbox"> Allow HTML?<br><br>
<input type="submit" value="Save">
</p>
</form>

any ideas?