Hi everyone, I need your help with this : I can't insert the content of in FCKeditor text field into tha database table.
Here is my code :
The field in the comment table where I want the text to be inserted is : comment_text
Please help me out,
Thanks.
Here is my code :
<?php include_once("fckeditor/fckeditor.php") ; ?> Add your comment <?php if (isset($_POST['submitted'])) { include ('config/mysql_connect.php'); if (empty($_POST['comment_text'])) { echo '<p><font color="red">You have to write a comment.</font></p>'; } else { $comment = $_POST['comment'] ; } if ($comment) { $query = mysql_query("INSERT INTO comments VALUES('','".$comment."')"); $result = mysql_query($query); if (isset($result)) { echo '<p><font color="red">Comment added successfully</font></p>'; } else { echo '<font color="red"><p>Comment not added.</p></font>'; } } } ?> <form method="post" action="addcomment.php"> <p> <b>Comment :</b> <br /> <?php $oFCKeditor = new FCKeditor('FCKeditor1') ; $oFCKeditor->BasePath = './fckeditor/' ; $oFCKeditor->Value = 'your comment here' ; $oFCKeditor->Create() ; ?> <!-- <textarea rows="7" cols="55" name="comment_text"> </textarea> </p> (Working fine with textarea) --> <p> <input type="submit" name="submit" value="Ajouter Commentaire" /> </p> <input type="hidden" name="submitted" value="TRUE" /></p> </form>
The field in the comment table where I want the text to be inserted is : comment_text
Please help me out,
Thanks.