On Monday, April 15, 2002, at 07:46  PM, Daniel Falkenberg wrote:

> Hey All,
>
> I am just about to go ahead and start validating form data.  I was
> thinking about tackling it in the following way...
>
> $data1 = param("data1");
> $data2 = param("data2");
> $data3 = param("data3");
> $data4 = param("data4");
>
> if ($data1 ne "Whatever") {
>   print "Not equal";
> elsif ($data2 ne "Test") {
>   print "Hello world";
> }
>
> ....
>
> else {
>   print "All form data is OK";
> }
>
>
> Of coarse I will be making it a little for stringent :) but is there a
> better way of tackling this?
>
> Regards,
>
> Dan

good one:   s/of coarse/of course/;
unless...
then there is:  s/for stringent/more stringent/;

anyway, if you demand that the user enters a specific string in a form, 
why bother?
so let's assume you will be testing the values for legitimate characters. 
and/or maybe a set of values.
other than that, the problem would be you would want to let the user know 
which input is bad, and make them re-enter the data.

we are entering total cgi territory, here. better stay with that list.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to