Jump to content

Rich Text & MySQL Submission/Retrieval


teesee07

Recommended Posts

Hey guys... new member here, and somewhat new to PHP (though I have extensive HTML and other programming background).  I did some searching around, as I don't like to post commonly answered questions, and unfortunately the only answers I found to my question didn't work.

 

Essentially, I am trying to create a VERY basic forum for a website I am working on.  It isn't going to be very rich in features, but I would like to allow users to do things such as make bold/italic/underlined text among the other basic features in rich text editors.  The problem I am having is when it comes to STORING the rich text posts into the MySQL database.  When I create a post with rich text, the MySQL entry is empty... and I know it is not an issue with the MySQL query because it works fine if I do it with regular text (plus the MySQL entry is made, but the post entry is empty).

 

I have been searching high and low on the internet (including on phpfreaks) and cannot seem to find any answers.  Some answers said too make the column a BLOB instead of TEXT, but that did not work.  Some answers said to do mysql_real_escape_string(), but that did not work.  Some said to try addslashes() on submission and stripslashes() on retrieval, but that did not work (didn't think it would).

 

Please tell me someone on here can help me out!  Thanks in advance everyone.

Link to comment
Share on other sites

It's nothing but a crap shoot to try to guess what the problem might be without at least seeing the code that handles the insert, and a <pre> formatted print_r() of the $_POST array after the form has been submitted.

 

This is more than likely going to end up being a PHP issue, so moving the thread to PHP help . . .

Link to comment
Share on other sites

I found a script from NicEdit.com which automatically converts <textarea> to rich text boxes.  I did download FCKEditor but from reading the website I was under the impression it'd essentially just do the same thing for me, so I didn't bother to install it.  I assume you think I should give it a shot?

 

And just for reference once I do install it, I assume I will need to use mysql_real_escape_string() on the $_POST array before it is input into MySQL in order to prevent tampering with the database by hackers via html?  Is there anything else that I should use on the array to ensure people can't screw with the site in that sense?

 

Thanks a lot guys... I was just about to post my add_topic.php code until I saw the second reply about most of the editors converting to html markup.  Figure I should probably give that a try to save people from headaches if that is all the issue is.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.