Jump to content

FreshCat

New Members
  • Posts

    2
  • Joined

  • Last visited

FreshCat's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yes, It might be a solution. How to implement it, have you the time to show me?
  2. So, i need this. I have a input button and, lets say, 2 checkboxes in a form. Form is about ordering items. Button - value-10 "Modern Pen" Checkboxes - value-300 (checkbox1) label-"Galaxy S3" and value-350 (checkbox2) label-"Galaxy S4" When user makes calculation my script need to make the job and say: "Dear user you have selected Modern Pen and Galaxy S4 and it costs 360€." I have this code, and it tells Sum of all selected items (this 360€), but I cant print labels of forms. Can someone tell me the easiest way (with example) of how to use, lets say value="10,ModernPen" in one input button/checkbox or any other way of making it do what i want? What can I do with this code to do what I need? This works, now I need improvement. <form action='order.php' method='post'> <label> <input type='radio' name='Pen' value='10' id='Pen' /> Modern Pen</label> <label> <input type="checkbox" name="Phone[]" value="300" id="Phone" /> Galaxy S3</label> <label> <input type="checkbox" name="Phone[]" value="350" id="Phone" /> Galaxy S4</label> <input type='submit' name='Submit' value="Calculate" /> </form> <?php $pen = $_POST['Pen']; if (!empty($_POST['Phone'])) { $Phone = 0; foreach ($_POST['Phone'] as $value) { $Phone += $value; } } $sum = $pen + $Phone; echo "You Ordered items cost is:<br />"; echo "<div style='clear:both'></div><div class='style'><h3> $sum €</h3></div>"; ?> Please? Any help?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.