Page 1 of 1

textarea protection

Posted: Tue Sep 12, 2006 3:17 pm
by lexhue
I’m new to php and need a simple solution or have one explained in plain English, Please.

I have textareas on a page and need for the user to be able to use ' or " and another character on the keyboard without causing problems. The information is then submitted to a mysql database.


I have tried looking this up but I dont really even know what keywords i should be using. Is there some type of make safe command I use when describing the textarea or what?
Is it the addslashes command and if so where would this go?


Any help would be greatly appreciated


Thank you

Lex

Posted: Tue Sep 12, 2006 3:36 pm
by feyd
mysql_real_escape_string().. we have many threads of example usage laying around.

Posted: Tue Sep 12, 2006 3:52 pm
by lexhue
THANK YOU :D

Posted: Wed Sep 13, 2006 2:56 am
by Maugrim_The_Reaper
If the content should contain no html, and it will be read from MySQL for display in a browser - htmlentities() is something to look into.