I have a set of 13 questions, each in one large form. The questions are part of select fields, and I have huge blocks of "if, else if" statements to check them, like this:
if ($_POST[ques1] == "red") {
//actions for red
}
else if ($_POST[ques1] == "blue") {
//actions for blue
}
else if ($_POST[ques1] == "yellow") {
//actions for yellow
}
else if ($_POST[ques1] == "green") {
//actions for green
}
else if ($_POST[ques1] == "orange") {
//actions for orange
}
else if ($_POST[ques1] == "purple") {
//actions for purple
}
That's not the actual script, but that's just the idea of what I am trying to say. I am just wondering if there is an easier way to write that without having to do a ton of "Else if" statements?