Pretty simple question, I think:
I'm creating a PHP form and want to prevent users from entering the same
response in more than one form field. How can I have the script check
for identical fields on POST?
Thanks
Dave
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
been a key part in the success of
our business. Juan Carlos Saravia
-Original Message-
From: Dave Rosenberg [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 9:30 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Preventing Identical Form Fields
Pretty simple question, I think:
I'm
: Thursday, February 07, 2002 9:30 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Preventing Identical Form Fields
Pretty simple question, I think:
I'm creating a PHP form and want to prevent users from entering the same
response in more than one form field. How can I have the script check
Hi, I think that you could still use Chris' method, you will just have to
do it in a loop. Create an array of all the form fields, and then have a
nested for loop which just checks that none of the elements are equal.
$numelements = count($fieldarray);
for($i = 0; $i $numelements; $i++) {
With javascript onSubmit, but that ain't php, so with
if($form1==$form2){sendthembackwitherrors()}
Thanks Chris, but I have about 10 different fields and want to make sure
none of those are the same.
You could brute force it:
$ok = true;
if ($field1 == $field2 || $field1 == $field3 ||
Thanks y'all! Everything's workin great now.
Jon Haworth wrote:
With javascript onSubmit, but that ain't php, so with
if($form1==$form2){sendthembackwitherrors()}
Thanks Chris, but I have about 10 different fields and want to make sure
none of those are the same.
You could brute force
6 matches
Mail list logo