Jump to content

Recommended Posts

Posted

Hi,

 

I'm making a backend system for my client's site, where she can upload her own articles for her e-zine by typing it in. Once she clicks on the submit button, the article's added to the mySQL db.

 

However, while testing it, I notice that if I have say 3 paragraphs with over a THOUSAND characters, it won't submit at all. But, if I type a few characters, it does work. Is there any way I can submit more than a thousand characters to the db?

 

Here's what I have: in the textarea of my form, I have character width of 100, and number of lines to 50. On the content field in my mysql db, I have it set to text.

 

Please help! :unsure:

Posted (edited)

A column of type TEXT should hold 65535 characters, so that's probably not the problem. Change it to MEDIUMTEXT (16777215 characters max) if you want to be sure but be aware that you'll have a lot of wasted space (useful reference: www.mysql.com/doc/en/Column_types.html ).

 

But I'd say the problem lies somewhere else.

 

It can't have anything to do with the text area's number of lines and columns as those are only there to format the HTML display.

 

Can you post an URL so I can take a look at the page and try to figure out if there's something wrong with the markup?

Edited by TCH-Raul
Posted

Hi,

 

I hear your little problem and something like a gut feeling says that I might know what your problem could be.

 

Are you "escaping" your input before trying to do anything with the data, like writing it to the database?

 

If you don't escape your input, and the user types in one of those important string delimiter characters, your program might end up chopping the string at that point, especially in words with conjuctions and all. Those single quote can get you!

 

Escaping your input usually means any unsafe character, including spaces and other unprintable characters, are translated into their corresponding hex values. Just remember to change them back when reading your data from the database.

 

To veryify that this is a probelm, type a whole bunch of letter-only input. If large amounts of text work without single quotes, double quotes, or other probable characters then you found the problem.

 

Good luck!

Posted

Ok, I tried the mediumtext thing, and I STILL doesn't work! ;) Any ideas anyone?

 

Like when I push submit after writing a large amounts of text, it doesn't do anything. Please help!! :(

Posted

Deno, I tried submitting some data through the form a few times and it went through just fine. I tried with a very long text and even typed a few "dangerous" characters (á, ' and " ) but it went through. Not sure what the problem could be... ;)

Posted

i see you fixed it. ;) I had this problem at a former job. It turned out that i couldn't submit (and actually capture) text using get when the entire url including the text area text was over 2000 characters which actually was more like 1960 or so since the other part of the url was about 40 characters long give or take. But i did like you did and switched the form method to post from get and it was solved.

 

Glad you got it fixed though.

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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