Topic: [TUTORIAL] How to make a simple calculator

Hello,

In this tutorial you will learn how to make a simple PHP calculator

<?php

if($submit)
{
   if($operator == '*')
   {
       echo $numa * $numb;
   } elseif($operator == '/')
   {
       echo $numa / $numb;
   } elseif($operator == '+')
   {
       echo $numa + $numb;
   } elseif($operator == '-')
   {
       echo $numa - $numb;
   }
} else { ?>
<form method="POST" action="<?php $_SERVER['PHP_SELF']; ?>">
 <input type="text" name="numa" size="10">
 <select name="operator">
 <option value="+">Add</option>
 <option value="-">Subtract</option>
 <option value="*">Multiply</option>
 <option value="/">Divide</option>
 </select>
 <input type="text" name="numb" size="10">
 <input type="submit" value="Calculate" name="submit">
</form>
<?php } ?>

Read more: http://www.webdesign.org/web/web-programming/php/php-calculator.10025.html#ixzz0TUVwwSds

Thumbs up

Re: [TUTORIAL] How to make a simple calculator

That's simple enough and quick and easy, which is how I prefer it.  Thanks so much for taking the time to share it.  I needed a calculator code.

Thumbs up

Re: [TUTORIAL] How to make a simple calculator

I am a new php learner. I am also learning web designing using php and some CMS. I am working on a project where I have to place a calculator, so I was looking for the php code for that. Your thread is perfect for me. I have tried it. It's working very well.

Thumbs up

Re: [TUTORIAL] How to make a simple calculator

Divorces shouldn't be long and carried out slowly. Both parties usually want a clean break and a chance to move on from the hurt and anger. An attorney will keep the situation professional and help take care of important issues such as custody arrangements, assets and debt responsibilities. The divorce attorney California Divorce Attorneyimportant paper-work and will do their best to give the client a fair fight.

Thumbs up

Re: [TUTORIAL] How to make a simple calculator

Day trading is an extremely risky way of investing in the stock market. Day trading is carried out by day traders who rapidly purchase and sell stockMake money day tradingover a single day period in the hope that for the very short period over which they hold the stocks (ranging from just a few seconds to a couple of hours) the value will continue to climb or fall thus allowing day traders to secure quick profits.

Thumbs up

Re: [TUTORIAL] How to make a simple calculator

In reality, there is little, if any, money saved by renting an owner-direct condo. You may actually pay more, especially whenEichhörnchen Kostüm comparing weekly rates. Almost all management company rates include free night discounts for weekly stays, but the majority of owner-direct pricing does not.

Thumbs up

Re: [TUTORIAL] How to make a simple calculator

In recent years, online shopping has become popular; however, it still caters to the middle and upper class. In order to shop online, one must be able to have access to a computer, a bank account and a debit card. Shopping has evolved with the growth of technology. According to research found in the Journal of Electronic Commerce, if one focuses on the demographic characteristics of the in-home shopper, in general, the higher the level of education, income, and occupation of the head of the household, the more favourable the perception of non-store shopping., Enrique.(2005) The Impact of Internet User Shopping Patterns and Demographics on Consumer Mobile Buying Behaviour.
1Y0-A18 exam
6101.1 exam
156-215.70 exam
1Z0-525 exam
1Z0-531 exam
1z0-877 exam
1Z0-527 exam
6203.1 exam

Thumbs up