You are here: Re: get price script « All PHP « IT news, forums, messages
Re: get price script

Posted by Steve on 10/13/23 11:28

> 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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация