Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2012
    Posts
    51
    Tokens
    313

    Exclamation Help Requested! Anybody have any idea what's the go?

    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&prime;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))
    {

  2. #2
    Join Date
    Mar 2010
    Location
    Cornwall (UK)
    Posts
    2,329
    Tokens
    6,755
    Habbo
    -Nick

    Latest Awards:

    Default

    I don't quit get what you mean,... Are you trying to make a table or ?


    Quote Originally Posted by xxMATTGxx View Post
    Nick is harmless and he's not a bad person after you have spoken to him a few times.
    Last +REP from: Kardan


  3. #3
    Join Date
    Oct 2006
    Posts
    9,900
    Tokens
    26,832
    Habbo
    Zak

    Latest Awards:

    Default

    Quote Originally Posted by Grumke View Post
    I don't quit get what you mean,... Are you trying to make a table or ?
    He is attempting to retrieve data I'm guessing as the SQL always starts with SELECT.

    Though I'm as stumped as you as to what he's trying to do.

    Do you even have all the tables and field names required to run that query?

    Because that just looks copy and pasted from some site to me lol

  4. #4
    Join Date
    Nov 2012
    Posts
    51
    Tokens
    313

    Default

    Thank-You for your reply.
    I have had this sorted out already.
    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •