+ Reply to Thread
Results 1 to 9 of 9

Thread: Creating calculators
      
   

  1. #1
    yuval613 is offline Corporal
    Join Date
    Jan 2007
    Posts
    15

    Question Creating calculators

    Hello,

    I need to create some calculators. Is there an easy way to do it? Can I convert an existing calculator that can be found in a program like excell into HTML or JAVA script?
    They are not regular calculators, they have formulas in them.

    Thanks,

  2. #2
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default Re: Creating calculators

    You cannot convert the Excel to work on a website. Do google search on "calculator scripts" and you will find tons of Java script and Php scripts to use.

    To put them on your web page, generally you simply open an html box in the web builder and paste the code you have choosen to use. **If it isa php code, remember to give the page a php extension in the page properties.

    Save and publish.
    As an example- open a html box on your page and copy and paste the below code.
    <html>
    <head>
    <title> PHP Calculator </title>
    </head>
    <style>
    body, table, td {
    font-family: verdana;
    font-size: 10px;
    color: #FFFFFF;
    }
    </style>
    <body>
    <table width="300px" style="border: 1px solid black; background-color:#000000;">
    <tr>
    <td>
    <H3>Calculator</H3>
    <P>
    <form method=get action=<?php print $PHP_SHELF; ?>>
    Number 1: <input type=text name=number1><br>
    Number 2: <input type=text name=number2><p>
    <div align="center">
    <input type=submit name=submit value=Add style="border: 1px solid black; background-color: #000080; color: #FFFFFF">
    <input type=submit name=submit value=Subtract style="border: 1px solid black; background-color: #000080;color: #FFFFFF">
    <input type=submit name=submit value=Divide style="border: 1px solid black; background-color: #000080; color: #FFFFFF">
    <input type=submit name=submit value=Multiply style="border: 1px solid black; background-color: #000080; color: #FFFFFF">
    </form>
    </div>
    <?php
    if($submit =="Add") {
    $result =$number1 + $number2;
    echo "The sum of the two numbers is: $result";
    }
    if($submit =="Subtract") {
    $result =$number1 - $number2;
    echo "The difference of the two numbers is: $result";
    }

    if($submit =="Divide") {
    $result =$number1 / $number2;
    echo "The sum of the two numbers is: $result";
    }

    if($submit =="Multiply") {
    $result =$number1 * $number2;
    echo "The sum of the two numbers is: $result";
    }



    ?>
    </td>
    </tr>
    </table>
    </body>
    </html>
    Open the page properties and give the page a php extension. Save and publish.

    it is a very simple calculator. There are much better out there.

    Hope it helps get ya started.

    Andy
    PHP- is a blast!

  3. #3
    yuval613 is offline Corporal
    Join Date
    Jan 2007
    Posts
    15

    Default Re: Creating calculators

    Which command should I use if I want to have one submit button that will preform a few calculations and display a few results one next to the other?

    Example:
    Number1: 100
    Number2: 200

    When click submit I will see:

    Result 1: 150 ( Came from (100+200)/2)
    Result 2: 100 ( Came from 200-100)
    Etc..

    Thanks,

  4. #4
    Andy128's Avatar
    Andy128 is offline Major General
    Join Date
    Dec 2005
    Location
    Michigan
    Posts
    2,322

    Default Re: Creating calculators

    It is not a command- the script wil have to be written to perform the task as described.

    Look for calculator scripts on Google. There are tons to choose from.

    Andy
    PHP- is a blast!

  5. #5
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,061

    Default Re: Creating calculators

    Actually a excel type spreadsheet is feasible for most of excel's calculation functions. Have a look at this online, realtime order form where calculations are performed in real time. Fill in the quantities (you can only fill in the quantity fields) as well as the coupon (vh20) field. See how it reacts.

    This is done through Javascript but it is rather complicated.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  6. #6
    Tom vR's Avatar
    Tom vR is offline Brigadier General
    Join Date
    Apr 2007
    Location
    Centurion, South Africa
    Posts
    1,733

    Default Re: Creating calculators

    Hi George,

    I like your EXCEL idea. On my site I want to add some bond calculaters, for calculating how much home owners will pay per month, how much they need to earn for purchasing a home of a specific price, and many more calculation.

    How do you get your EXCEL spreadsheet to display on your web page? Do you upload the spreadsheet with e.g. FTP and call it up on the page? I've never attempted this before and would like to eagerly learn more as I love EXCEL.

  7. #7
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,061

    Default Re: Creating calculators

    I'm afraid that this is not so simple Tom,

    to be able to use an Excel spreadsheet on your website, maintaining the formulas and the calculations, the spreadsheet has to be transformed in a form. The cells that have standard text or fixed values are made readonly(so the visitor cannot edit them) whilst the output ones are realtime updated. This is done through Javascript. But the code is from mediumly to highly complicated, depending on the complexity of the calculations.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  8. #8
    Tom vR's Avatar
    Tom vR is offline Brigadier General
    Join Date
    Apr 2007
    Location
    Centurion, South Africa
    Posts
    1,733

    Default Re: Creating calculators

    Thank you George, that sound too complicated and I think it is too square for my round brain....

    I'm also negotiating with a local Bank institution to link to their calculaters, without seeing their vehicle finance calculaters.

    If my attempts fail, may I contact you through your website for assistance or creating something for me (at your price of course)?

  9. #9
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,061

    Default Re: Creating calculators

    Whenever you want.
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49