Content Management Site Problems

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nachoman316
Forum Newbie
Posts: 12
Joined: Sat Apr 11, 2009 6:40 am

Content Management Site Problems

Post 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?
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Content Management Site Problems

Post by Benjamin »

My thoughts are that we (or at least I) have no clue what you are talking about. Post your code please.
nachoman316
Forum Newbie
Posts: 12
Joined: Sat Apr 11, 2009 6:40 am

Re: Content Management Site Problems

Post 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.
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: Content Management Site Problems

Post by Darhazer »

You have to escape every text that you are trying to insert in the database, using mysql_escape_string()
AGISB
Forum Contributor
Posts: 422
Joined: Fri Jul 09, 2004 1:23 am

Re: Content Management Site Problems

Post 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
nachoman316
Forum Newbie
Posts: 12
Joined: Sat Apr 11, 2009 6:40 am

Re: Content Management Site Problems

Post 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.
Post Reply