Fri Feb 29, 2008 12:01 pm - How to get sales tax php calculate sales tax function form scripts
#643
How to get sales tax php calculate sales tax function form scripts
today i was writing a script for a shopping cart and ofcourse, i need to figure out how to show the sales tax for a price, so i came up with this simple easy to use script you can use for your website if you need to find out how you can get the tax for your state for example.
here is the script: just copy and paste into a text editor like notepad and save it as webune-tax.php then upload to your wesbite and open it with your broswer and see it in action.
here is the script: just copy and paste into a text editor like notepad and save it as webune-tax.php then upload to your wesbite and open it with your broswer and see it in action.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Sales Tax Function</title>
</head>
<body>
<p>This Function Script Created By Webune.com</p>
<p><img src="http://www.webune.com/images/headers/default_logo.jpg"></p>
<form name="form1" method="post" action="">
Price:<br>
<input type="text" name="price" value="<? echo $_POST['price']; ?>">
(example: 49.00) <br>
<br>
Enter Sales Rate:<br>
<input type="text" name="tax_rate" value="<? echo $_POST['tax_rate']; ?>">
(example: 8.25) <br>
<br>
<input type="submit" name="Submit" value="Submit">
</form>
<hr width="200" align="left">
<?
$Subtotal = $_POST['price'];
$Tax = round( (($_POST['price'] * $_POST['tax_rate']) / 100 ), 2);
$Total = ($Tax + $Subtotal);
?>
Subtotal: $<? echo $Subtotal; ?><br>
Tax : $<? echo $Tax; ?><br>
Total: $<? echo $Total; ?><br>
<p align="center"><a href="http://www.webune.com">More Free PHP Scripts >></a> </p>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Sales Tax Function</title>
</head>
<body>
<p>This Function Script Created By Webune.com</p>
<p><img src="http://www.webune.com/images/headers/default_logo.jpg"></p>
<form name="form1" method="post" action="">
Price:<br>
<input type="text" name="price" value="<? echo $_POST['price']; ?>">
(example: 49.00) <br>
<br>
Enter Sales Rate:<br>
<input type="text" name="tax_rate" value="<? echo $_POST['tax_rate']; ?>">
(example: 8.25) <br>
<br>
<input type="submit" name="Submit" value="Submit">
</form>
<hr width="200" align="left">
<?
$Subtotal = $_POST['price'];
$Tax = round( (($_POST['price'] * $_POST['tax_rate']) / 100 ), 2);
$Total = ($Tax + $Subtotal);
?>
Subtotal: $<? echo $Subtotal; ?><br>
Tax : $<? echo $Tax; ?><br>
Total: $<? echo $Total; ?><br>
<p align="center"><a href="http://www.webune.com">More Free PHP Scripts >></a> </p>
</body>
</html>
author: web hosting