Page 1 of 1

Content Management Site Problems

Posted: Sun May 17, 2009 7:27 am
by nachoman316
Hello I am building a small custom content management system for a client but I am having problems when I am inserting content in the form.

When I am inserting content through the form it will only accept so many characters before the form resets all the content to nothing and undoing all my hard work.

Any thoughts?

Re: Content Management Site Problems

Posted: Sun May 17, 2009 9:34 am
by Benjamin
My thoughts are that we (or at least I) have no clue what you are talking about. Post your code please.

Re: Content Management Site Problems

Posted: Sun May 17, 2009 1:43 pm
by nachoman316
Sorry about that its a charset problem I think single quotes seem to be messing things up when i am entering text that requires a single quote it is just not being inserted into the database.

I know it's a trivial thing but can this be over come?

my table columns type is text and it's collation is set to utf_bin.

My pages have charset="utf-8" encoding.

Re: Content Management Site Problems

Posted: Sun May 17, 2009 1:46 pm
by Darhazer
You have to escape every text that you are trying to insert in the database, using mysql_escape_string()

Re: Content Management Site Problems

Posted: Sun May 17, 2009 2:21 pm
by AGISB
As mentioned above, you need to escape.

Another thought might be something very obvious but sometimes overlooked. Do you use the correct kind of table to store the data in? e.g varchar instead of text

Re: Content Management Site Problems

Posted: Sun May 17, 2009 5:04 pm
by nachoman316
No I use text varchar probably would be better because it's just small amounts of text maybe 400 to 500 characters.

Thanks again guys appreciate the help.

Im a php noob but learning a little more every day.