I am trying to install a php script which, in this case, takes input from a web form, Down the box, (extra and trainers) and sum together them with a 20% tax at the top of the total. I'm not sure how to do the total, as well as 20% also take extra, I get an error at line 80 which is a very final closing tag (I am very new to php)
< Code> & lt; ? Php $ extras = array ('les' => 5, 'shoe polish' => 10, 'in-spirits' => 15); $ Instructors = array ('lacoste' => 50, 'k-swiss' => 45, 'puma' => 59, 'convergence' => 65); {$ Firstname = $ _POST ['First name']; Echo "first name $ firstname
"\ n"; } {$ Add2 = $ _POST ['AD2']; Echo "$ add2"; br / & gt; \ n "; } {$ Postcode = $ _POST ['postcode']; "$ Postcode
"; } {$ Contact = $ _POST ['contact']; Echo "you want to contact $ contact
" } {$ Instructors = $ _POST ['trainers']; Echo "You want instructors $ trainers
\ n"; } {$ Extra = $ _POST ['Extra']; Echo "The more you want, the $ extras are & lt; br / & gt; \ n"; } $ ExtraCost = 0; $ TrainerCost = 0; $ TotalCost = 0; $ Extra = $ _POST ['Extra']; If (in_array ($ extra, $ additional)) $ $ runningCost = $ extra [$ extra]; Echo "The cost of your extras is $ extraCost
Thank you very much!
$ additional value = array ('les' => 5,' shoe polish '= & Gt; 10,' in-salvage '=> 15); $ TrainerValues = array ('Lacoste' => 50, 'K-Swiss' => 45, 'Puma' => 59, 'Converse' => 65); If (isset ($ _ POST ['firstname'])) {$ firstname = $ _POST ['first name']; Echo "first name $ firstname
"\ n"; } If (isset ($ _ POST ['add2'])) {$ add2 = $ _POST ['add2']; Echo "$ add2"; br / & gt; \ n "; } If (isset ($ _ POST ['postcode'])) {$ postcode = $ _POST ['postcode']; "$ Postcode
"; } If (isset ($ _ POST ['contact'])) {$ contact = $ _POST ['contact']; Echo "you want to contact $ contact
" } If (Asset ($ _ POST ['Trainers'])) {$ Trainers = $ _POST ['Trainers']; Echo "You want instructors $ trainers
\ n"; } If (isset ($ _ POST ['extra'])) {$ extras = $ _POST ['extra']; Echo "The more you want, the $ extras are & lt; br / & gt; \ n"; } $ ExtraCost = 0; $ TrainerCost = 0; $ TotalCost = 0; $ Extra = $ _POST ['Extra']; If (array_key_exists ($ additional, $ additional value)) $ $ extraCost = (float) $ extra value [$ extra]; Echo "The cost of your extras is $ extraCost
Comments
Post a Comment