Jump to content

program an online calculator


badger56

Recommended Posts

hi !

 

I'm not a PHP master, now i'd like to program an online calculator on my website.

it's not the classical calculator with + / - / x / ln etc... but a specific, simple though, calculator.

I'd like even to be able to export the results of the calculations into a xls or csv file (that would be the next step)

 

Is that possible to do that with PHP ? or i should look more at javascript or java (dont like that idea) or flash etc...

 

Thanks for your replies ! :)

Link to comment
https://forums.phpfreaks.com/topic/217701-program-an-online-calculator/
Share on other sites

It's possible using simply HTML and PHP, however, would involve a page refresh each time a 'button' on the calculator was pressed. I personally think you would be better off using javascript for this.

 

When you say it's not a conventional calculator, what do you mean?

 

You could do it by appending each button press to a $_GET[] querystring or storing it in a $_SESSION[], should you decide to use PHP.

To clarify above, it means you would have to construct the query with just html, and then would require a page refresh for calculation.

 

You can definitely do this very easily using a form. In fact, I recently built a specific calculator for calculating usage and savings on different types of lightbulbs. Only used php and html.

 

If your calculator is *meant* to resemble that of a classic calculator you will definitely need to use javascript somewhere along the line to provide real time feedback.

 

Are you a developer yourself? Because if you don't even know where to start, it may be a better idea to hire somebody to do this for you and you modify to your tastes.

 

Here's a link:

 

Search Results

 

Hope that helps!

thanks very much for your replies guys ! :)

 

by not a conventional calculator, i mean, it's not the calculator you have on your iphone, or windows calculator etc... that tells you what is the result of 3x4 etc..

it's actually a VBA program that i have (a formula using exponential and all), and that i want to transpose to an online calculator, to propose to my visitors to do the calculations straight from the website.

 

you basically have 2,3 fields to fill with a number value, and when you click "result" it will tell you the result.

if i understood well, with javascript, you may not have to click any "result" button, it would show automatically. am i right ?

 

thanks anti-moronic, i'll start with some already existing scripts

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.