Re: Unique Format

From: Date: Wed, 22 Oct 2003 17:15:04 +0000
Subject: Re: Unique Format
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-31270@lists.php.net to get a copy of this message
Tonya, If the handle is only for display purposes in Html, you should look into the htmlentities () or htmlspecialchars () functions. htmlentities: http://www.php.net/htmlentities htmlspecialchars: http://www.php.net/htmlspecialchars Jordan S. Jones Tonya wrote:
PHP 4.3.3 and MYSQL I am constructing a site for gamers that has a member registration form with field 'Game Handle'. Gamers are funny in that their game alias can include just about any character you can imagine. Setting up an ereg for this would be quite difficult. However, I *do* want to protect my site from any malicious data entry. I have tried to strip_tags this field, but many gamers put their team tags in their handle or use < and > characters within the name, so an input like "<team9>Jester" results in the team being taken out and only Jester being left. While that is not so bad, if the user inputs a name like G<o>D, it changes the name signficantly. Anyone have any suggestions on how I can format the game handle variable so that it allows these characters while not leaving my site subject to malicious input? Thanks!
-- I am nothing but a poor boy. Please Donate.. https://www.paypal.com/xclick/business=list%40racistnames.com&item_name=Jordan+S.+Jones&no_note=1&tax=0&currency_code=USD

« previous php.db (#31270) next »