home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 4 / hacker04 / 04_HACK04.ISO / src / PHP / calc01.php < prev    next >
Encoding:
Text File  |  2001-10-03  |  2.8 KB  |  43 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <!-- saved from url=(0058)http://www.thickbook.com/srccode/phpessentials/calc01.phps -->
  3. <HTML><HEAD>
  4. <META http-equiv=Content-Type content="text/html; charset=windows-1252">
  5. <META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
  6. <BODY><CODE><FONT 
  7. color=#000000><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> 
  8. <BR><HTML> <BR><HEAD> 
  9. <BR><TITLE>Calculate Values</TITLE> <BR></HEAD> 
  10. <BR><BODY> <BR><BR><FONT color=#0000bb><?php 
  11. <BR><BR>$price </FONT><FONT color=#007700>= </FONT><FONT 
  12. color=#0000bb>10.00</FONT><FONT color=#007700>; <BR></FONT><FONT 
  13. color=#0000bb>$sales_tax </FONT><FONT color=#007700>= </FONT><FONT 
  14. color=#0000bb>.0825</FONT><FONT color=#007700>; <BR></FONT><FONT 
  15. color=#0000bb>$quantity </FONT><FONT color=#007700>= </FONT><FONT 
  16. color=#0000bb>4</FONT><FONT color=#007700>; <BR><BR></FONT><FONT 
  17. color=#0000bb>$sub_total </FONT><FONT color=#007700>= </FONT><FONT 
  18. color=#0000bb>$price </FONT><FONT color=#007700>* </FONT><FONT 
  19. color=#0000bb>$quantity</FONT><FONT color=#007700>; <BR><BR></FONT><FONT 
  20. color=#0000bb>$sales_tax_amount </FONT><FONT 
  21. color=#007700>= </FONT><FONT color=#0000bb>$sub_total </FONT><FONT 
  22. color=#007700>* </FONT><FONT color=#0000bb>$sales_tax</FONT><FONT 
  23. color=#007700>; <BR><BR></FONT><FONT 
  24. color=#0000bb>$grand_total </FONT><FONT color=#007700>= </FONT><FONT 
  25. color=#0000bb>$sub_total </FONT><FONT color=#007700>+ </FONT><FONT 
  26. color=#0000bb>$sales_tax_amount</FONT><FONT color=#007700>; 
  27. <BR><BR>echo </FONT><FONT 
  28. color=#dd0000>"<P>You ordered $quantity bags of coffee.</p>"</FONT><FONT 
  29. color=#007700>; <BR>echo </FONT><FONT 
  30. color=#dd0000>"<P>Bags of coffee are $price each.</p>"</FONT><FONT 
  31. color=#007700>; <BR>echo </FONT><FONT 
  32. color=#dd0000>"<P>Your subtotal is $sub_total.</p>"</FONT><FONT 
  33. color=#007700>; <BR>echo </FONT><FONT 
  34. color=#dd0000>"<P>Sales tax is $sales_tax in this location.</p>"</FONT><FONT 
  35. color=#007700>; <BR>echo </FONT><FONT color=#dd0000>"<P></FONT><FONT 
  36. color=#007700>\$</FONT><FONT 
  37. color=#dd0000>$sales_tax_amount has been added to your order.</p>"</FONT><FONT 
  38. color=#007700>; <BR>echo </FONT><FONT 
  39. color=#dd0000>"<P>You owe $grand_total for your coffee.</p>"</FONT><FONT 
  40. color=#007700>; <BR><BR></FONT><FONT color=#0000bb>?> 
  41. <BR></FONT><BR><BR></BODY> <BR></HTML> 
  42. <BR></FONT></CODE></BODY></HTML>
  43.