sentor Posted April 23, 2021 Share Posted April 23, 2021 <!DOCTYPE html> <html> <body> <form action="Practice 1.1.php" method="post"> Catagory Code:<input type="text" name="n" size="2"><br> Units Used <input type="text" name="u" size="2"> <br> <input type="submit" value="Calculate"> </form> <?php $a=$_POST['n']; $b=$_POST['u']; if ($b<=3.75) { echo ""; } ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/312539-can-anyone-help-me-to-solve-this-im-a-beginner-cant-really-figure-out-how-to-do-it/ Share on other sites More sharing options...
requinix Posted April 23, 2021 Share Posted April 23, 2021 Did you mark your own post as being "the solution" because you figured out the answer yourself? Or are you still having problems? Quote Link to comment https://forums.phpfreaks.com/topic/312539-can-anyone-help-me-to-solve-this-im-a-beginner-cant-really-figure-out-how-to-do-it/#findComment-1586123 Share on other sites More sharing options...
Barand Posted April 23, 2021 Share Posted April 23, 2021 Sorry, don't know a solution that will give you 914.01. Quote Link to comment https://forums.phpfreaks.com/topic/312539-can-anyone-help-me-to-solve-this-im-a-beginner-cant-really-figure-out-how-to-do-it/#findComment-1586128 Share on other sites More sharing options...
requinix Posted April 23, 2021 Share Posted April 23, 2021 3 hours ago, Barand said: Sorry, don't know a solution that will give you 914.01. Almost: 4.19 * first 75 units (314.25) + 5.72 * next 92 units (526.24) + 30 flat charge = 870.49, +5% VAT = 914.01 Quote Link to comment https://forums.phpfreaks.com/topic/312539-can-anyone-help-me-to-solve-this-im-a-beginner-cant-really-figure-out-how-to-do-it/#findComment-1586130 Share on other sites More sharing options...
Barand Posted April 23, 2021 Share Posted April 23, 2021 DOH! 🙄 Forgot to include the flat charge in the spreadsheet total formula (copied the "Units" total formula) and also completely missed the VAT element. Thus demonstrating the perils of copy/paste - a warning to all. Quote Link to comment https://forums.phpfreaks.com/topic/312539-can-anyone-help-me-to-solve-this-im-a-beginner-cant-really-figure-out-how-to-do-it/#findComment-1586131 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.