Re: Question: Validation on a text field

From: Date: Thu, 04 Nov 2004 21:31:03 +0000
Subject: Re: Question: Validation on a text field
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-201228@lists.php.net to get a copy of this message
Jay Blanchard wrote:
[snip] May I ask why you are suggesting this function ?
You can use htmlentities() on the information placed
[/snip] Because it will convert things like quotes into their HTML counterparts before you place them into the table. If you are reading it back out to a web interface they get properly displayed without any manipulation. http://www.php.net/htmlentities explains a little more in depth. It is one step towards preventing SQL injection and possible other hack attacks.
You should also use mysql_real_escape_string() on the data from the client. http://www.php.net/mysql_real_escape_string -- Ben Ramsey Zend Certified Engineer http://benramsey.com --------------------------------------------------- Atlanta PHP - http://www.atlphp.org/ The Southeast's premier PHP community. ---------------------------------------------------

« previous php.general (#201228) next »