Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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