Public feed #379678

PHP vat code

public php v1 · immutable
Raw Edit
·published 2007-03-03 12:41 UTC
rendered paste body
<html><head><TITLE></TITLE></head><body><h1>Vat Calculator</h1><?phpif($_GET['action']  == 'send'){$vat = $_GET['vat'];$price = $_GET['price'];echo "When the Price = ".$price."<BR>And the VAT = ".$vat."%".";?><BR>The Total Price will be: "."$".printf("%01.2f",VAT($vat, $price))."<BR><BR>" ;}function VAT($vat, $price){$vatt = $price;$vatt = $vatt / 100;$vatt = $vatt * $vat;$end = $price + $vatt;return $end;}?><form method="get" action="vat.php"><fieldset><legend>Vat and Cost</legend><p><label for="vat">VAT percentage:</label><input type="text" name="vat" size="25"/>%</p><p><label for="price">Price Of Object:</label>$<input type="text" name="price" size="25"/></p><p><input type="submit" name="action" value="send" /> </p></fieldset></form></body></html>