ElaKiri Community
Downloads
Go Back   ElaKiri Community > Computers & Internet > News & Discussion
Reload this Page PHP Calculator (here how to create)
Reply
 
Thread Tools Display Modes
(#1)
Old
Hackr's Avatar
Hackr Hackr is offline
Senior Member
Hackr is an unknown quantity at this point
 
Posts: 206
Join Date: May 2006
PHP Calculator (here how to create) - 09-07-2006, 05:40 PM

Make a working calculator using PHP.
This tutorial will teach you how to make a calculator using PHP. Firstly, create a new .php document and copy/paste the following code into it.

< ?php
/* Calculator */
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"/>
<input type="text" name="operator" size="2"/>
<input type="text" name="numb" size="10"/>
<input type="submit" value="Calculate" name="submit"/>
</form>
< ?php } ?>

Done.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
E Books lpeera Downloads 507 Today 11:35 AM
Create Ringtone v 4.94 sam7 Downloads 1 05-28-2011 12:44 PM
Usefull php scripts85 for webmasters... gazaly Tips & Tricks 0 09-29-2007 01:24 PM
HTML 2 PHP Convertor - StrightSlate blacksmoke Web Development 2 08-23-2007 06:16 PM
How to Create a Bootable USB Flash Drive or USB Key with Vista WinPE 2.0 Anusha Tips & Tricks 4 04-03-2007 08:14 PM



Copyright © 2006 - 2011 ElaKiri™ Beta2.Evo vBulletin, vBa iBproArcade Subdreamer I-Magic MKv
Optimisation plugin by DBtech

Page generated in 0.05531 seconds with 7 queries