Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7783943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:59:30+00:00 2026-06-01T19:59:30+00:00

Lately I have been designing and coding a website for one of my clients.

  • 0

Lately I have been designing and coding a website for one of my clients. One of the functions he needs is a calculator in PHP. The problem is, I can get the calculator up and running and I could probably make the calculator in jQuery as well, but he wants the result of the calculation on the next page. The calculator should be able to do simple calculations that include: multiplication, dividing, subtracting and adding. So far I have styled up and made the HTML structure of the calculator, but when it comes to the PHP code… I have no clue. So is there anyone here that has any experience of coding a calculator but showing its result in on a different page?

Preferably, you could use the HTML structure I have built:

<input type="text" title="result" class="input-result" name="result" readonly="readonly" value=""/>
<div class="row-container">
    <ul class="row1-ul">
        <li class="row1 calc-1 numbers">1</li>
        <li class="row1 calc-2 numbers">2</li>
        <li class="row1 calc-3 numbers">3</li>
        <li class="row1 calc-x">X</li>
    </ul>
    <ul class="row2-ul">
        <li class="row2 calc-4 numbers">4</li>
        <li class="row2 calc-5 numbers">5</li>
        <li class="row2 calc-6 numbers">6</li>
        <li class="row2 calc-/">/</li>
    </ul>
    <ul class="row3-ul">
        <li class="row3 calc-7 numbers">7</li>
        <li class="row3 calc-8 numbers">8</li>
        <li class="row3 calc-9 numbers">9</li>
    </ul>
    <ul class="row4-ul">
        <li class="row4 calc-0 numbers">0</li>
        <li class="row4 calc-+">+</li>
        <li class="row4 calc--">-</li>
    </ul>
    <div class="column-last calc-=">=</div>
</div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:59:31+00:00Added an answer on June 1, 2026 at 7:59 pm

    Since you say you could probably do it in jQuery, that would be the best idea. Wrap the whole calculator in something like this

    <form action='result.php' method="post">
        <input type="hidden" name="finalresult">
    

    and have a button enter the final result into that hidden input before performing form.submit() (which is what an input of type submit does by standard). Your PHP script in “result.php” will be able to access the result as $_POST['finalresult']. Remember this comes from a script so it’s user input and can potentially be anything they are trying to do to wreck your scripts though.

    Edit: $_POST['finalresult'] will be a variable which you can use in the PHP script of results.php. Enter the result into the input using .val(num) and in results.php do something like var $calc_result = (float) $_POST['finalresult']; to avoid users fiddling around.

    You will need at least the basics of PHP so I suggest you have a read through the w3 PHP tutorials: http://www.w3schools.com/php/php_syntax.asp (also see the $_POST one in the side bar).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on a website and lately have been using GD with
Lately I have been doing a security pass on a PHP application and I've
I have been designing many applications for my company lately where fancy interfaces have
lately I have been messing around with the Silverlight Business Application template to get
Lately I have been trying my hands on Eclipse IDE for java development. I
Lately I have been experiencing Eclipse Galileo (3.5) slowing down under Java 1.5b12 OR
Lately i have been wondering if there is a performance difference between repeating the
Lately I have been reading a lot of blog topics about big sites(facebook, twitter,
Lately I have been watching Pluralsight intro videos on MVC 3. I have never
I've been using Mercurial for some development lately and have been loving it. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.