Posted by steve on 10/13/68 11:28
hey...you just took money out of someone's wallet. this guy sounds like he'd
pay big money out of lack of knowledge. ;^)
"Steve" <googlespam@nastysoft.com> wrote in message
news:1128430323.561497.50480@g47g2000cwa.googlegroups.com...
> can anyone here do a php script to calculate the price of Venetian blinds
> once the client has put in their measurements ??
It's probably trivial but you still haven't stated what the calculation
involves. Let's guess...
<!-- calc.html -->
<html>
<head><title>Cost Calculator</title></head>
<body>
<p>Type your measurements into this form and click Calculate...</p>
<form method="post" action="calc.php">
Width (m): <input type="text" name="width_m" />
Height (m): <input type="text" name="height_m" />
<input type="submit" value=" Calculate... " />
</form>
</body>
</html>
<?php
// calc.php
define( 'COST_IN_POUNDS_PER_SQUARE_METRE', 10.00 );
$width_m = intval( $_POST['width_m'] );
$height_m = intval( $_POST['height_m'] );
$cost_pounds =
round( $width_m * $height_m * COST_IN_POUNDS_PER_SQUARE_METRE, 2
)
print 'Thanks for your query.<br />';
print 'Your blinds will cost £' . $cost_pounds . '<br />';
print 'This is not a quote. Errors and Omissions Excluded.<br />'
print 'Make <a href="calc.html">another calculation</a>';
?>
---
Steve
Navigation:
[Reply to this message]
|