Simple calculation standalone app

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
abhic
Forum Newbie
Posts: 10
Joined: Sat Sep 27, 2003 3:56 pm

Simple calculation standalone app

Post by abhic »

Hey guys,
I just ran into your forum site and would like to post a request. Don't know if Iwill get flamed or not for this. But I work in a small business and need to do these calculations on a very regular basis. Right now I am doing this manually, but I would like to get this automated and get a tiny app for this. If anybody would like to help, that would be deeply appreciated.

Thank you.

n= user input

if (n<=300)
i=((30*n)/100)

if (n>300&&n<=1000)
r=n-300
i=((30*n)/100)
i=i+((25*r)/100)

if (n>1000)
r=n-300
s=n-700
i=((30*n)/100)
i=i+((25*r)/100)
i=i+((20*s)/100)

print i
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

did you do some research??
you need to do a form for the user input
fetch that number from the $_POST array
and then do the math.. and echo the result.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

you can buy it for € 20 :p

test live at http://timvw.madoka.be/stuff/calculator.php
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

lol. Go tim!!
Post Reply