Hello everyone,
I'm a newbe and working on this quiz program.
I have this six field forum that a user fills out.
question, correct answer, required incorrect answer
which is required.
optional answer1, optional answer1, optional answer1
which is optional and can be left blank.
Proccess Forum
$create_question // The question text submitted
$create_correct // The required correct answer text submitted
$create_required // The required incorrect answer submitted
$optional_1 // An optional incorrect answer (if not blank)
$optional_2 // An optional incorrect answer (if not blank)
$optional_3 // An optional incorrect answer (if not blank)
If any two or more of the above variables has the same value.
e.g. $create_question =phpbuilder & $optional_2 =phpbuilder
I'll like to display the message.
"You have two or more of the same values in the fields.
<a href"'blahblah''> BACK</A>"
and exit the database insert.
The rows (question,answers) cannot be unique.since the same value(s) may be
submitted in another forum.
my question is:
is there an array of some sort that i can use to match all 6 values
at one time.
and display the message
without having to do the if's
e.g.
if ($optional_2 ==$optional_3)
{
message_duplicate();
}
if ($optional_1 ==$optional_3)
{
message_duplicate();
}
and so on..........
any help is appreciated.
Thanks,
Dave