Hello PHP Builder,
I've just started down this <?php road and I've been really struggling with a problem the last few days. Exhausted of things to try, I'm left asking, nay hoping you, the community can guide me in the right direction.
What I'm attempting to do is a simple survey regarding 15 military type items.
Each item is used by the armed forces and the goal is take input they have regarding said items.
I was able to get the initial survey part done without much trouble, of course my code is rather monolithic to say the least.
A link to that code is here.
A link to the output is here.
Once all of the items have been given an answer (using a drop down, 1 of 4 choices) they are entered into one table along with a timestamp and unique token to stop page refresh duplication.
This was fine until I got ready to move the data to the next requirement.
Now I need to take the results and sort by the 1-4 drop-down choice they provided and then present them back to the soldier in order for them to then choose another drop down value, a grouping if you will.
Well I'm pretty sure that means if I was going to sort on these 1-4 choices I couldn't just slam it all into one table so I normalized the data some and broke all of this stuff out into different tables. ie...Items, People, 1-4Choice, 1-3Choice_applied_to_sort_of_firstChoice, and Survey to house each decision.
From there I'm not sure what's the best angle of approach moving forward. I'm trying to avoid doing this way wrong out of the box.
I've been trying to use $_SESSION tokens with md5(uniqid) to keep each users answers together but as I run through the stages I keep getting the tokens regenerated.
Am I on the right track trying to use one multi-session page or is there an easier/efficient way?
I started fresh with this continued attempt in multi-page sessions but I haven't even got to the sql data insert part and already am struggling with how to store the data uniquely for each sessions answers.
Would anyone mind helping me understand an optimal way of designing such a questionnaire? Even if it's a framework idea that's sound I would appreciate your input.
Hooah,
-A