Re: matching two form fields function?
| From: | Dennis Moore | Date: | Thu, 23 May 2002 20:51:59 +0000 |
| Subject: | Re: matching two form fields function? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-98987@lists.php.net to get a copy of this message | ||
Also make sure you trim() the input variables before your comparison...
2cents...
/dkm
----- Original Message -----
From: "Kevin Stone" <kevin@helpelf.com>
To: <php-general@lists.php.net>
Sent: Thursday, May 23, 2002 4:30 PM
Subject: Re: [PHP] matching two form fields function?
> Tis a tad easier than that.
>
> function match_str($str1, $str2)
> {
> if ($str1 == $str2)
> return true;
> else
> return false;
> }
>
> // If the fields don't match exit with error.
> if (!match_str($field1, $field2))
> {
> echo "The fields must match.";
> exit;
> }