On Mar 22, 2004, at 5:30 AM, matthew perry wrote:


I am trying to allow my users to enter quotes in their strings. For instance instead of writing: 2 inch rod, they can write 2 " rod. The problem is, of course, that " ends the string and all that is saved is any value before the ". How do I get around this without using textarea?

Use a function like mysql_real_escape() when you store data in your database to escape all inserted data, which prevents SQL injection attacks along the way. I'm not sure if you mean, but since you are talking about textarea's I guess you want to know how to display quotes in an <input> field. This is quite simple: convert the quotes to valid HTML with htmlentities()...


Please read the manual for more information about these functions. Hope this helps...

Regards,

Filip de Waard

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to