php sessions and determining if x value has been selected via sessions -


The problem, I want to use sessions, but I'm having problems applying sessions to my $ food array like If the user chooses a pizza, I do not offer him or her sandwich, similarly if the user selects a sandwich, then I do not give the user a pizza.

I also want to know that the user has already selected a pizza or sandwich

$ food = array ("pizza" => $ _POST [ "Pepperoni"], "sandwich" = & gt; $ _ POST ["cockpit switch"]); // How do I set up every $ food element as it will get its own session? // In addition to checking if $ food ["pizza"] is selected or not? ($ $ [[Pizza "] ')) ($ $ [[pizza"]') = $ _SESSION ('$ food [pizza]'] '' echo '' is already selected as pepperoni ";} and { Echo "Select a pizza";}

In relation to the structure of the code above, ps, and syntax I know that there are many problems, this is the reason I ask for help Thank you for Fleming, Newbie

  // How do I set up every $ food element like it Have your own session?  

structure should be something like this:

  $ _ session [' food '] [' pizza '] =' pepperoni '; $ _SESSION [' food '] [' sandwich ' ] = 'Chicken sandwich'; // Check if food [pizza] is selected / defined (if ($ _ session ['food'] ['pizza'])) {resonates "you have already been selected "$ _SESSION ['food'] ['pizza'];} and {echo" select a pizza ";}  


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -