Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BASIC PROBLEM 1

Status
Not open for further replies.

tekpr00

IS-IT--Management
Jan 22, 2008
186
CA
Hello All I am getting several errors and I was wondering if you could help me for this basic PHP PROBLEM. Mostly, when I call this from my loca drive it works, but on remote server it shows several problem.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://wwww.w3.org/1999/xhtml"[/URL] xml:lang="an" lang="en">
 <head>
  <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
  <title> Product Cost Calculator </title>
  <style type="text/css" media="screen">
	.number { font-weight: bold;}
	</style>
 </head>
 <body>
 <?php // Script 4.2 - handle_calc.php
 /* This script takes values from
 caculator.html and performs tatal cost and monthly payment calculations */

 // Adress error handling, if you want.

 // Get the values from the $_POST array
$price = $_POST['price'];
$quantity = $_POST['quantity'];
$discount = $_POST['discouint'];
$tax = $_POST['tax'];
$shipping = $_POST['shipping'];
$payments = $_POST['payments'];

$total = $price * $quantity;
$total = $total + $shipping;
$total = $total - $discount;

//Determing the tax rate:
$taxrate = $tax/100;
$taxrate = $taxrate +1; 

//Factor in the tax rate:
$total = $total * $taxrate

//Calcualte the monthly payments:
$monthly = $total /$payments;

//Print out the results:
print "<div>You have selected to purchase:<br />
<span class=\"number\">$quantity</span> widget(s) at <br />

<span class=\"number\">$prices</span> price each plus a <br />

<span class=\"number\">$shipping </span> shipping cost and a <br />

<span class=\"number\">$tax</span> percent tax rate. <br />

After your <span class=\"discount\">$discount</span> the total cost is<br />

<span class=\"number\">$total</span>.<br />

Divided over <span class=\"number\">$payments</span> monthly payments, that would be $<span class=\"number\">$monthly</span> each.</p> <div>";

?>
</body>
</html>
 
this part of your code is wrong
Code:
Divided over <span class=\"number\">$payments</span> monthly payments, that would be $<span class=\"number\">$monthly</span> each.</p> <div>

but in truth it is very difficult to assist you when you do not tell us what errors you are getting.
 
Also, where is the opening <p>?

Code:
Divided over <span class=\"number\">$payments</span> monthly payments, that would be $<span class=\"number\">$monthly</span> each.[red]</p>[/red] <div>

-Geates

"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top