Foxcom
04-01-2013, 07:51 AM
Hello Guys,
I'm very stuck.
I'm doing a simple forum script and i have integrated CKEditor and everything seems to be find although when i submit my post the result turns out in code?
(It's not formatting the HTML code it's actually displaying it)
I've been messing around for some hours now and i am very stuck, I'll post an example:
(Quick Reply - CKEditor) Content:
Hello
Test
One
Two Three!
(View Reply) Content:
<p> Hello<br /> <br /> Test<br /> One<br /> Two Three!</p>
I'm in desperate need and don't have much time on my hands. If anybody could please help me out.
This is the code to display the result:
' . htmlentities(($posts_row['post_content'])) . '
This is the textarea code:
<textarea class="textarea" id="editor1" name="reply-content" rows="7" cols="51"></textarea><script type="text/javascript">
CKEDITOR.replace( "editor1" );
</script>
This is the main code to get the results:
$sql = "SELECT
topic_id,
topic_subject
FROM
topics
WHERE
topics.topic_id = " . mysql_real_escape_string($_GET['id']);
$result = mysql_query($sql);
if(!$result)
{
echo 'The topic could not be displayed, please try again later.';
}
else
{
if(mysql_num_rows($result) == 0)
{
echo 'This topic doesn′t exist.';
}
else
{
while($row = mysql_fetch_assoc($result))
{
//display post data
echo '<table class="topic" border="1" width="719" bordercolorlight="#C0C0C0" bordercolordark="#C0C0C0">';
//fetch the posts from the database
$posts_sql = "SELECT
posts.post_topic,
posts.post_content,
posts.post_date,
posts.post_by,
users.user_id,
users.user_name
FROM
posts
LEFT JOIN
users
ON
posts.post_by = users.user_id
WHERE
posts.post_topic = " . mysql_real_escape_string($_GET['id']);
$posts_result = mysql_query($posts_sql);
if(!$posts_result)
{
echo '<tr><td>The posts could not be displayed, please try again later.</tr></td></table>';
}
else
{
while($posts_row = mysql_fetch_assoc($posts_result))
{
I'm very stuck.
I'm doing a simple forum script and i have integrated CKEditor and everything seems to be find although when i submit my post the result turns out in code?
(It's not formatting the HTML code it's actually displaying it)
I've been messing around for some hours now and i am very stuck, I'll post an example:
(Quick Reply - CKEditor) Content:
Hello
Test
One
Two Three!
(View Reply) Content:
<p> Hello<br /> <br /> Test<br /> One<br /> Two Three!</p>
I'm in desperate need and don't have much time on my hands. If anybody could please help me out.
This is the code to display the result:
' . htmlentities(($posts_row['post_content'])) . '
This is the textarea code:
<textarea class="textarea" id="editor1" name="reply-content" rows="7" cols="51"></textarea><script type="text/javascript">
CKEDITOR.replace( "editor1" );
</script>
This is the main code to get the results:
$sql = "SELECT
topic_id,
topic_subject
FROM
topics
WHERE
topics.topic_id = " . mysql_real_escape_string($_GET['id']);
$result = mysql_query($sql);
if(!$result)
{
echo 'The topic could not be displayed, please try again later.';
}
else
{
if(mysql_num_rows($result) == 0)
{
echo 'This topic doesn′t exist.';
}
else
{
while($row = mysql_fetch_assoc($result))
{
//display post data
echo '<table class="topic" border="1" width="719" bordercolorlight="#C0C0C0" bordercolordark="#C0C0C0">';
//fetch the posts from the database
$posts_sql = "SELECT
posts.post_topic,
posts.post_content,
posts.post_date,
posts.post_by,
users.user_id,
users.user_name
FROM
posts
LEFT JOIN
users
ON
posts.post_by = users.user_id
WHERE
posts.post_topic = " . mysql_real_escape_string($_GET['id']);
$posts_result = mysql_query($posts_sql);
if(!$posts_result)
{
echo '<tr><td>The posts could not be displayed, please try again later.</tr></td></table>';
}
else
{
while($posts_row = mysql_fetch_assoc($posts_result))
{