Jump to content

Online order form, total troubles !


gordontbh

Recommended Posts

Hi,

 

i am very new to PHP and have created an on line order form for my company, i am on the final page now, where i need to display the details they have chosen. I am having trouble with the totals, there is an option for the quantity of products u want, this can either be 50, 100, or 200, now on the last page i need to display;

 

Order Details:

Quantity: $quantity of products

 

and then in Total section:

Quantity Price: $which needs to be based on the quantity of products.

 

i tried to do it using a switch, and got it to echo the right price into a hidden field, which works, but i cant get it to diplay, here is the code;

 

<html>
<body>
<input type="hidden" name="odr" value="<?php
$x=$_POST['x'];
switch ($x)
{
case 50:
  echo "65";
  break;
case 100:
  echo "96";
  break;
case 200:
  echo "129";
  break;
default:
  echo "Error!";
}
?>">
<br>
<br>

<?php
$odr=$_POST['odr'];
echo"$odr";
?>

</body>

 

is this completely wrong? is there an easier way?

 

this is just a snippet of the main code, :s

 

the whole order form can be viewed here; (just select online order)

Think ur have to PM me :)

 

thanks any help would be realy gd cheers

James

Link to comment
https://forums.phpfreaks.com/topic/65025-online-order-form-total-troubles/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.