> > 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 || .... ) $ok = false;
if ($field2 == $field3 || $field2 == $field4 || .... ) $ok = false;
if ($ok == false) sendThemBackWithErrors ();

Or you could use array_unique:

// Substitute $_GET if you're using GET instead of POST ;-)
if ($_POST != array_unique ($_POST)) sendThemBackWithErrors ();

I'm not sure if this second one would work - I don't know if you can do
straight comparisons of arrays - but the idea is to check that the submitted
array is the same as the array with all the duplicates removed (if it isn't,
there was a duplicate).


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to