I am trying to submit one piece of form information to an array that is part of a conditional expression. I'd like to have everything one page if possible. Submit to self, etc.
For example:
user enters ticket number and submits (there are 10 winning numbers out of 100). Each ticket has a specific prize, so the prize array will have 2 parts - ticket number/prize.
form passes value to php script
if ticket number is a winner, user gets a "you won" message, and has to then fill out the new form that appears with their address, etc. that will get emailed to me, along with what they won.
when they submit their information, I want the ticket number to be added to an array called "$alreadyWon".
Then, the next time that same ticket number is entered, the script will compare the number against the $alreadyWon array to see if the prize has been claimed, and if so, they get a "you already won, please enter a different ticket number".
else
the ticket number is compared against the winning ticket number array (not worried about duplicates here, since if they already won, that should have been captured in condition 1 - the $alreadyWon array.
else
the ticket number is not a winner, and the user will get a polite, "sorry, not a winner, better luck next time" message.
I have tried passing the ticket number from a form to a script and doing an echo to see the array, but it only shows the value that I just entered. I need the array to be written to, so that any winning ticket cannot be won twice.
Any help would be greatly appreciated.
Mike