Jump to content

My form doesn't work, please help


razzor

Recommended Posts

Here's my problem, I built an HTML form to process my order using html kit. Now when I plug in numbers in my form, a new browser opens up and spits out all the code from my "processorder.php" including all my html tags. What can I do to make my form process my order?

Thanks,

 

Here's a look at what I get once hit submit:

 



<html>
   <head>
      <title>Bob's Auto Parts - Order Results</title>
   </head>
   <body>
       <h1>Bob's Auto Parts</h1>
       <h2>Order Results</h2>


            <?php 
	//create short variable names
		$tireqty=$_POST['tireqty'];
		$oilqty=$_POST['oilqty'];
		$sparkqty=$_POST['sparkqty'];
	//variable declarations
		$totalqty=0;
		$totalamount=0.00;
	//constant definitions
		define ('TIREPRICE',100);
		define ('OILPRICE',10);
		define ('SPARKPRICE',4);

		$totalqty=0;
		$totalqty=$tireqty + $oilqty+$sparkqty;
		$totalamount =$tireqty*TIREPRICE
			  +$oilqty*$OILPRICE
  			+$sparkqty*SPARKPRICE;

		$taxrate = 0.1; //local tax rate is 10%
		$totalamount=$totalamount * (1+$taxrate);



		echo 'isset($tireqty): '.isset($tireqty).'<br />';
		echo 'isset($nothere): '.isset($nothere).'<br />';



		echo '<p>Order processed at ';
		echo date('H:i, jS F');
		echo '</p>';

		echo '<p>Your order is as follows: </p>';
		echo $tireqty.' tires<br />';
		echo $oilqty.' bottles of oil<br />';
		echo $sparkqty.' spark plugs<br />';


		echo 'Items ordered: '.$totalqty.'<br />';
		echo 'Subtotal: $'.number_format($totalamount,2).'<br />';
		echo 'Total including tax: $'.number_format($totalamount,2).'<br />';

?>


   </body>
</html>

 

 

 

 

Link to comment
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.