I am doing a project where开发者_如何转开发 user can post text, i have used TinyText.
i need to know how much input user should be allowed to do ? i came to know TinyText allows only 255 characters to be entered from http://www.htmlite.com/mysql003.php But if a user enters & then it have to be converted to & and so... So what should be the ideal size allowed to be inputted from the users for these field/data typesTinyText
Text
User can insert data, but can not edit !
An user can view others data ! So, view will be used mostly !Here you can find details about MySQL text type: http://dev.mysql.com/doc/refman/5.0/en/blob.html
I don't think replacing html entities and insert them into your database lets you control the final length that is inserted into your tinytext.
I'd go for 2 options.
- Insert raw data into the database, and use htmlentities on outputting.
- Restrict it to an maximum amount of characters, but use a larger text-type.
Depending on your application I'd pick one.
精彩评论