php - How to multiply session values -


i trying create menu booking. if select meal set 1 , price $100, meal set 2, price $200 , selected value multiple amount of tables request below code price showing $0 in total.

if($_post['radiogroup1'] == 'meal set 1')       {         $menuprice = '100';       }       else if ($_post['radiogroup1'] == 'meal set 2'){         $menuprice = '200';       }      else if ($_post['radiogroup1'] == 'meal set 3'){          $menuprice = '300';      }     //store price of menu in session     $_session["pricemenu"] =$menuprice;    ?>  

// display amount

<?php $_session['total'] = ($_session["pricemenu"] *           $_session['nooftables']);               echo $_session['total'] ?><br> 

put $menuprice = ''; in front if statement make global. can't not take string out of if statement before making global. had problem before , work me. hope you.


Comments

Popular posts from this blog

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -