dimanche 29 novembre 2015

PHP form handling of checkbox values to cart

I have what seems to be a unique situation. I would like to have a check box form that shows on a page:

Exam Study Guide - Add $100.00 "check box here" Online Test Simulator - Add $200.00"check box here"

I would like to be able to choose either box or both and have the total dollar amount sent to my shopping cart via a submit button.

I have been trying to create an array and then add the amounts within the array so that they can be passed to the cart somehow. This is as far as I have gotten, the echo was a test to see if the process worked...it did not.

I was thinking that I could do a form action to create the array, then process that array giving me a number that could then be passed to the shopping cart.

if (isset($post['h'])){
    $a=array(h);
    echo array_sum($a);
    }

Exam Study Guide - Add $100.00
Online Test Simulator - Add $100.00



Aucun commentaire:

Enregistrer un commentaire