home *** CD-ROM | disk | FTP | other *** search
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <!-- saved from url=(0058)http://www.thickbook.com/srccode/phpessentials/calc01.phps -->
- <HTML><HEAD>
- <META http-equiv=Content-Type content="text/html; charset=windows-1252">
- <META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD>
- <BODY><CODE><FONT
- color=#000000><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
- <BR><HTML> <BR><HEAD>
- <BR><TITLE>Calculate Values</TITLE> <BR></HEAD>
- <BR><BODY> <BR><BR><FONT color=#0000bb><?php
- <BR><BR>$price </FONT><FONT color=#007700>= </FONT><FONT
- color=#0000bb>10.00</FONT><FONT color=#007700>; <BR></FONT><FONT
- color=#0000bb>$sales_tax </FONT><FONT color=#007700>= </FONT><FONT
- color=#0000bb>.0825</FONT><FONT color=#007700>; <BR></FONT><FONT
- color=#0000bb>$quantity </FONT><FONT color=#007700>= </FONT><FONT
- color=#0000bb>4</FONT><FONT color=#007700>; <BR><BR></FONT><FONT
- color=#0000bb>$sub_total </FONT><FONT color=#007700>= </FONT><FONT
- color=#0000bb>$price </FONT><FONT color=#007700>* </FONT><FONT
- color=#0000bb>$quantity</FONT><FONT color=#007700>; <BR><BR></FONT><FONT
- color=#0000bb>$sales_tax_amount </FONT><FONT
- color=#007700>= </FONT><FONT color=#0000bb>$sub_total </FONT><FONT
- color=#007700>* </FONT><FONT color=#0000bb>$sales_tax</FONT><FONT
- color=#007700>; <BR><BR></FONT><FONT
- color=#0000bb>$grand_total </FONT><FONT color=#007700>= </FONT><FONT
- color=#0000bb>$sub_total </FONT><FONT color=#007700>+ </FONT><FONT
- color=#0000bb>$sales_tax_amount</FONT><FONT color=#007700>;
- <BR><BR>echo </FONT><FONT
- color=#dd0000>"<P>You ordered $quantity bags of coffee.</p>"</FONT><FONT
- color=#007700>; <BR>echo </FONT><FONT
- color=#dd0000>"<P>Bags of coffee are $price each.</p>"</FONT><FONT
- color=#007700>; <BR>echo </FONT><FONT
- color=#dd0000>"<P>Your subtotal is $sub_total.</p>"</FONT><FONT
- color=#007700>; <BR>echo </FONT><FONT
- color=#dd0000>"<P>Sales tax is $sales_tax in this location.</p>"</FONT><FONT
- color=#007700>; <BR>echo </FONT><FONT color=#dd0000>"<P></FONT><FONT
- color=#007700>\$</FONT><FONT
- color=#dd0000>$sales_tax_amount has been added to your order.</p>"</FONT><FONT
- color=#007700>; <BR>echo </FONT><FONT
- color=#dd0000>"<P>You owe $grand_total for your coffee.</p>"</FONT><FONT
- color=#007700>; <BR><BR></FONT><FONT color=#0000bb>?>
- <BR></FONT><BR><BR></BODY> <BR></HTML>
- <BR></FONT></CODE></BODY></HTML>
-