Re: test for illegal characters and consequences

From: Date: Wed, 05 Apr 2006 21:34:07 +0000
Subject: Re: test for illegal characters and consequences
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-233241@lists.php.net to get a copy of this message
Paul Scott wrote:
On Tue, 2006-04-04 at 15:32 -0800, Angelo Zanetti wrote:
Ive developed a site and now I've come to the stage where I need to test each textfield on each form for illegal characters that have been inputted. I would like to know from some of you how you go about it?
In our framework, we use a few methods, depending on what needs to be done in what way... If you look at our wiki module, we use AJAX to check for valid PageNames when using SmashWordsTogether. In our other forms we use a form validation object that checks for numeric, alphanumeric, textonly etc on form submission. It sounds as though the AJAX route is more what you are looking for. If you would like some help let me know, or ask on our developers list.
hi Paul. Thanks for the reply. So what do you do if someone enters illegal characters in one of your form? Do you inform the user and prompt them to enter the fields again or do you just strip out all the bad characters and enter the rest of the info into the database? Im concerned with what to do once a user has added the bad characters. I will be using a regular expression. thanks in advance

« previous php.general (#233241) next »