Help with PHP script

This is probably really simple but here goes:
I have been asked to help convert a formula from an excel spreadsheet to work on a webpage.
I have to the best of my ability converted the logic of the spreadsheet into what I believe is PHP variables/code but have no idea how to integrate it in some html to allow someone to input a number - pass it to the PHP script, have the php script perform the calculation and then have the result returned to the webpage.

This is the PHP code I have created.

[code]

<?php $vpg = 4.5; $cpp = 0.35; $wr = 35; $vpexv = 100 /117.5 * $vpg; $cpw = $customers * $cpp; $tcpw = $cpw + $wr; $cnpw = $customers * $vpexv; $ppw = $cnpw - $tcpw; $anp = $ppw * 52; $ppm = $anp / 12; ?>[/code]

Basically, the $customers variable is what is taken as an input from the website, processed in the script above (not tested) and then returned to the webpage. Ideally I want a input box which someone can enter a number and click a button that says ‘calculate’ then the answer is returned.

If anyone can offer any help either with a working demo or pointing me in the right direction I would appreciate it very much.

Sponsor our Newsletter | Privacy Policy | Terms of Service