BuBBaG
Jun 27 2008, 09:27 AM
Yes, I made some basic calculators to use for simple math problems, nothing big. I'm a newbie at php, so if I made something that could be short, long, I am sorry. lol Here is one for adding two numbers. CODE <html> <title>Adding 2 numbers </title> <body> <h3 align="center">Type in the two numbers you'd like to add together.</h3>
<form action="add2.php" method="post"> <input type="text" name="number1" /><p>+</p> <input type="text" name="number2" /> <input type="submit" value="Add!" /> </form>
</body> </html> Save that and name it add.php or add.html, it don't matter. In that page, it is simply asking for 2 numbers to add. Next, create a page called add2.php, can't make it html. CODE <?php $_POST["number1"]; $_POST["number2"]; ?> <html> <title>Answer to <?php echo $_POST["number1"]; ?> + <php echo $_POST["number2"]; ?></title> <body> <h3 align="center">Answer to <?php echo "$_POST["number1"]; ?> + <php echo $_POST["number2"]"; ?></h3>
<p> The answer to <?php echo $_POST["number1"]; ?> + <php echo $_POST["number2"]; ?> is <?php echo $_POST["number1"]+$_POST["number2"]; ?> </body> </html> Php files can have html in them.lol What this page is doing is adding the two numbers that were inputed on add.php(what I used). Simple right? Here is subtraction, for this, I copied and pasted the adding script/pages and made new ones called subtract.php, for the first one and subtract2.php for the second. I changed the adding to subtracting and yeah. CODE <html> <title>Subtracting 2 numbers </title> <body> <h3 align="center">Type in the two numbers you'd like to subtract.</h3>
<form action="subtract2.php" method="post"> <input type="text" name="number1" /><p>-</p> <input type="text" name="number2" /> <input type="submit" value="Subtract!" /> </form>
</body> </html> And CODE <?php $_POST["number1"]; $_POST["number2"]; ?> <html> <title>Answer to <?php echo $_POST["number1"]; ?> - <php echo $_POST["number2"]; ?></title> <body> <h3 align="center">Answer to <?php echo "$_POST["number1"]; ?> - <php echo $_POST["number2"]"; ?></h3>
<p> The answer to <?php echo $_POST["number1"]; ?> - <php echo $_POST["number2"]; ?> is <?php echo $_POST["number1"]-$_POST["number2"]; ?> </body> </html> yeah. I also made a calculator for finding a circles area and circumference with just entering the diameter. First, make a file called circle.php, copy and paste this code in it. CODE <html> <title>Enter the Diameter </title> <body> <h3 align="center">What is this circles circumference and area?</h3> <p> Just enter the diameter.</p>
<form action="circle2.php" method="post"> Diameter(d): <input type="text" name="d" /> <input type="submit" value="Submit" /> </form>
</body> </html> Next, make a file named circle2.php. In it, it will solve for area and circumference using two formulas. Where D=diameter R=radius C=circumference A=area. For circumference; D*pi=C For area; pi*®^2=A Unless I'm horrible at math, those are false, but I'm excellent at math, so no worries. Now, to make that file. CODE <html> <title>Area and Circumference </title> <body> <h3 align="center">Answers to Area/Circumference</h3> <?php $_POST["d"]; ?>
<?php $d=$_POST["d"]; $r=$d/2; $r2=$r*$r; $pi=pi(); ?> <p>The aree and circumference of a circle with a diameter of <?php echo $d; ?> are<br /> Area:<?php echo $pi*$r2; ?><br /> Circumference:<?php echo $pi*$d; ?>
</p>
</body> </html> Now, just copy and paste, and it works. For multiplication and devision, change the + or - to * or /. Adding is + Subtracting is - Multiplying is * Dividing is / If you have any questions, feel free to ask. I'll also make a calculator at request, just post the formula for it, I'll make it and test it first, then give you the codes. Yours truly, Bubba.
Reply
minimcmonkey
Jun 27 2008, 03:42 PM
I think it would be a lot beter, if you put in a button, which allowed you to choose the operator, so a minus button, a luse button, and multiply and divide buttons. It shouldn't be too hard to do, you would just have to make the page, use a different PHP script, depending on which button you pressed. Or you could use radio buttons (actually thi would probably be beter)
Reply
optiplex
Jun 27 2008, 04:58 PM
nice, thats cool. I like the last piece of code, howto on calculation areas, never thought about that with php. PHP Supports nice math functions, im sure with php its possible to make great calculators. You could use radio buttons yes, but its also possible to make real buttons, using winbinder, then compile to executable I belive winbinder has a example on howto make an real calculator application using php Oh found it, here you go http://winbinder.org/examples.php- optiplex
Reply
coolcat50
Jun 27 2008, 06:27 PM
Well, for a better calculator, use Javascript for basic operations, and PHP for complex ones using AJAX as well. Nice script though.
Reply
BuBBaG
Jun 28 2008, 02:51 AM
Thank you guys.  I don't wanna do buttons or anything cause I'll like get confused. lol. I'm not too good with html.
Reply
Recent Queries:--
php mathmatical calculator with code with examples - 34.44 hr back. (1)
-
make math calculator php html - 38.30 hr back. (1)
-
making calculator words - 39.81 hr back. (1)
-
calculator made using php - 43.29 hr back. (1)
-
add, subtraction, multiplication calculator free code "vb6" - 46.63 hr back. (1)
-
codes used in making a calculator using vb6 - 65.59 hr back. (1)
-
winbinder copy paste - 67.82 hr back. (1)
-
how to make a calculator in html - 69.30 hr back. (1)
-
php form calculator without database - 107.52 hr back. (1)
-
java howto make a calculator - 109.79 hr back. (1)
-
subtract2.php - 125.26 hr back. (1)
-
creating a pallet calculator with visual basic - 125.68 hr back. (1)
-
make a calculator in php - 128.73 hr back. (1)
-
create a simple math calculator in php - 137.73 hr back. (1)
Similar Topics
Keywords : making calculators php calculator scripts- Making Winrar Archives
- and adding password to winrar archives (13)
**** This tutorial will show you how to put files into .rar Archive and pass worded (if wanted)
**** What You Will Need Before continuing you will need a couple of thing, first of all you
need WINRAR , which is a very powerful archive manager. It can reduce size for you email
attachments, decompress RAR, ZIP and other types of files downloaded from the internet. You can get
winrar at http://www.rarlabs.com The other thing is that make sure your using Windows XP because
this is what I used to make this tutorial. I think it works with any other windows not...
Making A Song In Fruity Loops Part Three
- part three precusion (1)
ok part three now which covers the precusions setup of the small song i built for this tutorial.
the nesecery files can be downloaded here the image below is included in the precusions folder as
it mught not be entierly visable within this post so shold you need it its there also the images
purpose is to enable you to see what i am refering to within this tutorial lateron. now what i
have done above is blackd out every pattern that has nothing to do with the precusion. so the
patterns displayed in light grey are the only patterns i will be refering to. ok lets b...
Ftp In Visual Basic 6.0
- Start making your FTP client using VB6 (1)
Recently, I had a need to make a FTP client, since our webhosting FTP server was kind of exotic, and
very restrictive, and most of uploads, even though they reach 100% would crash... File would be
uploaded to a server, but FTP clients just froze upon completion, waiting for the 226 (OK) from FTP
server... So, I had to make my own, one who would not wait for 226, but instead, watch the file
pload progress... This tutorial is not fuly complete, in the sense that it does not offer COMPLETE
FTP client functionality (for example, I ddn't write the code for FTP download, ...
Calculator In Mozilla Firefox
- must be online to use this (6)
There will be a google search box at the top right corner (by default) If you have browser
Firefox, you should have and Google search box. You could not only search with this thing, but also
make calculations. It also calculates sin, cos, exponentiation, square… You could use it instead
of windows calculator /smile.gif" style="vertical-align:middle" emoid=":)" border="0"
alt="smile.gif" />...
How To Make An Ultimate Game List.
- If you're making a site on video games or such. (0)
How To: Make A Simple Php Site
- Making one file show up on all pages using php (21)
I have looked all over the site and could not find anything that was like this simple, or just like
this at all.. For some people i know that you are using a basic HTML site...and having a big menu
if you want to add somthing you have to go into every one of the pages and add or remove or edit
what you want to do, but with somthing verry simple all you would have to do is edit one file, and
all of the pages that have the PHP script on them would suddenly change to what that one file is.
So to start off if you are planning on using this little tirck, the page that you a...
Tutorial: Installing D-shoutbox For Ipb V1.2
- Making your installation even easier (12)
Over the course of the summer I have tried hard to install a shoutbox into a new forum I was
developing. I went to the Invisionalize forums and found several mods for shoutboxes, but none of
them seemed to work. I first tried to install the D-Shoutbox, but upon this first try, I was
unsuccessful. Eventually, after much frustration, and trying other mods, which didn't seem to
stack up to Dean's features, I was determined to make it work. For some, editing your files (to
the newbie that is) can be difficult, with everything looking like a foreign language (basi...
Making Interactive Cds With Flash
- My second flash tutorial for Beginners (2)
Im back again with what i think it would be an interesting tutorial for all of you guys who wants to
take flash out of the web and make really cool interactive CDS. First of all if all of you are
thinking right now: "this dude is wrong for making interactive cds you have to use macromedia
Director", well you are right macromedia director it's used to build interactive cds and dvds
among other things, but you can also make interactive cds with Flash, the thing is: if you want to
make a simple interactive CD you can totally do it with flash, of course Director brings ...
Simple Scripts In Html And Javascript
- Things like BackgroundColorChanger and so (7)
like in the topic, here is a description how to change the Backgroundcolor "On The Fly", by klicking
on a button or radio-box first, we ned the html-and body-tags, create a new html-file on your
desktop and write the following: QUOTE <script language = "JAVASCRIPT">
browser interpretation: html - tag means "hey, browser, here comes HTML" in the body-tag you define
the looking of your site. you can add things like "bgcolor" for the background, "text" for the
textcolor and link / alink / hlink / vlink to define the linkcolor ( ) the scripttag i...
[php] Clean Code Functions
- Clean up your html output from php scripts (5)
There is another Topic about writing 'clean' HTML code posted elsewhere on the Forum.
I'll edit this Topic and add the link so you can review it on your own, and there is no need for
me to comment on it in this thread, but the purpose of this Topic is to introduce a pair of
functions which can be used for making sure that the HTML output from my scripts is readable when a
view-source is reviewed. Two handy functions are included here. They work together quite nicely,
and I will start this Tutorial with a short summary of the reasons for their 'being...
Cpanel Preinstalled Scripts, Extras, And Cpanel Options
- Part 6 of My 7 Part Tutorial (1)
This Tutorial will be divided into 7 different parts, and this is the first part, when i get the
other parts together, i will post the links under here /biggrin.gif" style="vertical-align:middle"
emoid=":D" border="0" alt="biggrin.gif" /> Enjoy. Part 1: E-mail Management Part 2: Useful Site
Management Tools Part 3: Useful Site Management Tools2.1 Part 4: Analysis/Log Files Part 5:
Advanced Tools Part 7: Fantastico Detailed Cpanel Tutorial Part 4: PreInstalled Scripts,
Extra, and Cpanel Options In this tutorial I will, in detail explain all of th...
Check Your Scripts
- (4)
As I am reading through some of the (Mostly PHP) scripts posted here, the following posts are that
of people saying that the script does not work. I suggest that you should test and make sure that
your script works BEFORE you post it here. Craig....
Making A Song In Fruity Loops Part 2
- part 2 the second melody (0)
ok i am going to attach the midi file againe incase you didnt get it from the first part in this
part i will demonstright how to create and insert the second mellody ok so you have your first
mellody wich is ecetially the comein chord as i call it. now open the midi file you put in your left
panel during the first tutorial and drag the mellody 2 © onto the pallet but click on pattern two
in the right site playlist box. now like in the first tutorial replace with sytrus. for this type
of mellody use something in the leads section of the plugin.for this you need to ...
Creating A Resume
- 10 Tips For Making A Resume (1)
I've been working on my Resume for months now. Here is a summary of what I've learned: 1.
Avoid referring to yourself via 1st person or 3rd person terms. Rather than saying "I started this
job in" just say "Began job in"... Employers expect Resumes to be professional and avoid reference
to oneself; and instead speaking in an impersonal tone that presents
achievements/skills/experience/education without personalization. Avoid words like "I", "my", "he",
"she", etc. Leave out personal pronouns and only use the action words/verbs. This also includes
your Ob...
How To Install Php Scripts
- for people who don't like uploading all the time (0)
OK. Here's what you need: 1. Web hosting that has FTP 2. A script or something to install 3.
A program called SmartFTP I'll use my site for an example... 1. Enter your FTP login info
2. When you login in your files, images, and stuff will show up. 3. Now that you're logged in
you have to choose what file you want to import into your website. Go to "My Documents" and right
click on the file you want to put on your site and select "copy". 4. Next you got to open put the
dictionary that your website is in. Ok what that means the place where the "i...
Making A One Page Does All Website In Phph
- (2)
Hello and Great Day or Night either one. Have you ever been to a site and seen a index page or any
page at all control everything such as index.php?do=home&action=logout something similar to the
above? Well I am going to show you how easy it is to make this all own your own, and only have to
use one web template or design to make it work. Before we get started you need to go ahead and find
the web design that you want to use. After you find the site you want to use go ahead and save
it... and save it like this so we can work together, ok! Note* We are going to ...
Making a java based program
- (3)
Java GUI Making a Little Java Program Sec. 1: Imports and starting it off Sec. 2: Variables Sec.
3: Frame and Stuff Sec. 4: Declaring buttons Sec. 5: Adding buttons Sec. 6: Action Listening Sec. 7:
Using this for a learning experience Section 1 Now, let's think. What imports do we need? We
obviously need GUI imports. We also need the action Listener. So, let's declare this at the very
top: Code: CODE import java.awt.*; import java.awt.event.*; import javax.swing.*; That's
all we need to get all our supplies. Now to start us off. Skip a couple lines ...
Making The Popular Id Browsing For Your Site.
- (17)
Was just sitting and being bored but then I realized I could show how to create more or less popular
?id=page browsing. It's actually really easy. I know two ways how to do it. First one I learned
was checking the variable and if it's true including the text/file/anything needed and so on. It
was ok, but sometimes I just couldn't make it work so I switched to switch() function and
that's what I'm going to show you guys right now. So, I made a test page which contains the
code needed and here is its source. CODE <!DOCTYPE HTML PUBLIC ...
Making A Dynamic Page On Blogspot
- Using an external server to make your pages hosted on blogspot dynamic (5)
Good morning everyone. Have you ever wondered how to allow your visitors to edit content on your
blog? Like adding a post straight off the page, adding a link, editing your profile etc. This will
be extremely useful if you want your visitors to contribute to your blog besides writing comments or
tagging. 1. Adding a post straight off the page. Go to blogger.com, login, select your blog. Go to
settings -> email. By enabling blog email, you can now add a post by simply sending an email to the
address you specified. The address should look something like: yourusername...
Fantastico Scripts - A 'how To'
- (0)
This isnt really a tutorial, more like an idiots guide on how to avoid the problems I encountered
when setting up my site. This eventually invoved 3 complete reinstalls - you soon learn from your
mistakes when that happens. I shall use php-nuke as the example here, but it applies to all scripts
you intend to modify. If you have the disk space available - install your script twice, set up a
temporary sub-domain for this. The reason for this is you have a full, clean install to go back &
retrieve any files you may mess up whilst changing code (you will have to do this ...
Making A Webserver Directory Listing
- Helps you organise your webserver (6)
I recentely installed IIS with PHP and MySQL on my pc (previous I used UniServer, but that
doesn't matter here). But I had always to go to http://localhost/websiteiwanted or I had to
create a shortcut on my desktop for every site so I decided to create an "overviewpage". It shows
all the websites in your wwwroot with a link to them. If you have folders you don't want to be
included, you extense the && check (but I'll explain this lateron) Here's the total code:
CODE <ul> <table cellpadding="3" cellspacing="3" border="...
How To: Install Scripts And Create Database
- preinstalled scripts, own scripts (2)
How to install php scripts using MySQL,phpMyAdmin on Trap17 using preinstalled script/auto
installation cPanel > Preinstalled scripts > "Addon Scripts" or "Fantastico" or "phpBB" or the
scripts which you wanted to install screenshot - >
http://i6.photobucket.com/albums/y222/haalaaluu/5.jpg explaination: this method is auto install
the scripts in public_html folder, database name and granted database user respect to its database.
note: by Addon Scripts, you can not choose other folder structure. by fantastico you can choose the
folder structure and it is good ...
Making Shadows Without Images
- (4)
Im going to show you very simply how to create boxes with Shadows using div tags and css, no images
needed, meaning fat pageload times! /biggrin.gif' border='0' style='vertical-align:middle'
alt='biggrin.gif' /> You simple need to create two layers, one behind the other, the one behind
will have a top and left margin on 20px, the one infront 10px, set teh background colour of the one
behing darker than teh one infront, you should end up with something like this: Here is th html
to create this effect: CODE <div id="Layer1" style="position:...
Making A Website
- Also Some Dos and Don'ts (6)
I had originally had this posted on my domain at nevernormal.com, and thought that you guys could
use it here as well. Granted, this is geared to the uber newbie, so don't razz me if I
don't suggest the most advanced in web design. lol So, you want to make a website? 1.
First, think about what you want your site to be about. There are fanfic sites, like Drastic
Measures and fanfiction.net ; cliques or clubs, like the BtVS Writers' Guild ; or, if you
want, you could have a general site, whether it be about a show/movie you like, or even just about y...
Looking for making, calculators, php
|
*RANDOM STUFF*
*SIMILAR VIDEOS*
Searching Video's for making, calculators, php
*MORE FROM TRAP17.COM*
|
advertisement
|
|