| Notices |
You need to register and log in, in order to post and download files. |
| Scripts & Tutorials The official AeonCube products and other scripts, code snippets and tutorials. |
 |

February 24th, 2007, 11:08 AM
|
|
AeonCube Administrator
|
|
Join Date: Aug 2006
Location: United Kingdom
Posts: 1,364
|
|
|
[free] Easy Calculator [v1.0]
Add a simple to use calculator for your users to add up sums online.
Click here to download
__________________
HostMediaUK : Low Cost Hosting | Linux PHP Hosting | Windows ColdFusion Hosting | ASP Hosting | Reseller Hosting | Dedicated Servers
AeonCube Networks : Web Design, ColdFusion Development and Web Hosting
|

April 4th, 2007, 10:22 PM
|
|
Member
|
|
Join Date: Apr 2007
Location: Billingham
Posts: 70
|
|
|
Yeh once again very handy for a hosting website who offers lots of products online and there users can add up there bill if the hosting company dont have a shopping cart system installed on there server.
|

April 6th, 2007, 04:24 PM
|
|
Frequent Visitor
|
|
Join Date: Apr 2007
Posts: 21
|
|
|
But you would except a hosting site to have ecommerce or something like that
|

April 7th, 2007, 01:16 PM
|
|
Member
|
|
Join Date: Apr 2007
Location: Billingham
Posts: 70
|
|
|
thats why i said f the company dont have a shopping cart system !! Read
|

April 8th, 2007, 08:30 PM
|
|
Valued Member
|
|
Join Date: Oct 2006
Posts: 154
|
|
Meh mine's better
PHP Code:
<html> <head> <!-- Made by Zezikaro !--> <title>Calculator for Dummys</title> </head> <body> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <fieldseT> <legend>Please Enter Your Numbers</legend> <p>Input one : <input type="text" name="input"><? echo $input; ?> <br /> <br /> Input 2 : <input type="text" name="input2"> </p> <p>Select which you would like to do: <SELECT name="mode" size=1> <OPTION selected value="add"> Addition </OPTION> <OPTION value="minus"> Minus </OPTION> <OPTION value="multiply"> Multiply </OPTION> <OPTION value="square"> Square route of input one </OPTION> </SELECT> <br /> <input name="submit" type="submit" value="submit"> </p> </fieldset> </form> <?php if(isset($_POST['submit'])){ $input = $_POST['input']; $input2 = $_POST['input2'];
if(empty($input) || empty($input2)){ echo 'You have not provided all the information'; } elseif(!ereg ("([0-9])", $input)){ echo 'Please enter Numbers only'; } elseif( $HTTP_POST_VARS['mode'] === 'minus'){ echo $input - $input2; } elseif( $HTTP_POST_VARS['mode'] === 'add') { echo $input + $input2; } elseif( $HTTP_POST_VARS['mode'] === 'multiply') { echo $input * $input2; } elseif( $HTTP_POST_VARS['mode'] === 'square') { echo sqrt($input); } else { echo 'You have not given the correct information'; } } ?>
</body> </html>
one file
|

April 9th, 2007, 10:12 PM
|
|
Member
|
|
Join Date: Apr 2007
Location: Billingham
Posts: 70
|
|
|
Mines Better
Mines Better And Easier
PHP Code:
<?
if ($submit)
{
if ((!$one) || (!$two) || (!$calc))
{
echo("<font face=\"Tahoma\" size=\"2\" color=\"#FF0000\"><b>Oops, you forgot to supply some information. Please correct the problem below.</b></font><br>");
} else if ((!ereg("[0-9]",$one)) || (!ereg("[0-9]",$two))) {
echo("<font face=\"Tahoma\" size=\"2\" color=\"#FF0000\"><b>Please restrict your input to only numbers.</b></font><br>");
} else {
if ($calc == "add") {
$total = $one + $two;
} else if ($calc == "sub") {
$total = $one - $two;
} else if ($calc == "mult") {
$total = $one * $two;
} else if ($calc == "div") {
$total = $one / $two;
} else if ($calc == "mod") {
$total = $one % $two;
}
printf("The answer is: <b>%.2f", $total . "<br>");
}
}
?>
<FORM METHOD="post" ACTION="calc.php">
<P><font face="Tahoma" size="2"><b>Input value 1: <br><INPUT TYPE="text" NAME="one" SIZE=20></b></font></p>
<p><font face="Tahoma" size="2"><b>Mathematical operation:</b></font><br>
<font face="Tahoma" size="2">
<input TYPE="radio" NAME="calc" VALUE="add">add
<input TYPE="radio" NAME="calc" VALUE="sub"> subtract
<input TYPE="radio" NAME="calc" VALUE="mult">multiply
<input TYPE="radio" NAME="calc" VALUE="div"> divide
<input TYPE="radio" NAME="calc" VALUE="mod"> modulus
</b></font><br><br>
<font face="Tahoma" size="2"><b>Input value 2: <br><INPUT TYPE="text" NAME="two" SIZE=20></b></font></p>
<P><INPUT TYPE="submit" NAME="submit" VALUE="Do Calculation"></p>
</FORM>
</BODY>
</HTML>
|

April 10th, 2007, 11:21 AM
|
|
Valued Member
|
|
Join Date: Oct 2006
Posts: 154
|
|
Quote:
Originally Posted by johnson
Mines Better And Easier
PHP Code:
<?
if ($submit)
{
if ((!$one) || (!$two) || (!$calc))
{
echo("<font face=\"Tahoma\" size=\"2\" color=\"#FF0000\"><b>Oops, you forgot to supply some information. Please correct the problem below.</b></font><br>");
} else if ((!ereg("[0-9]",$one)) || (!ereg("[0-9]",$two))) {
echo("<font face=\"Tahoma\" size=\"2\" color=\"#FF0000\"><b>Please restrict your input to only numbers.</b></font><br>");
} else {
if ($calc == "add") {
$total = $one + $two;
} else if ($calc == "sub") {
$total = $one - $two;
} else if ($calc == "mult") {
$total = $one * $two;
} else if ($calc == "div") {
$total = $one / $two;
} else if ($calc == "mod") {
$total = $one % $two;
}
printf("The answer is: <b>%.2f", $total . "<br>");
}
}
?>
<FORM METHOD="post" ACTION="calc.php">
<P><font face="Tahoma" size="2"><b>Input value 1: <br><INPUT TYPE="text" NAME="one" SIZE=20></b></font></p>
<p><font face="Tahoma" size="2"><b>Mathematical operation:</b></font><br>
<font face="Tahoma" size="2">
<input TYPE="radio" NAME="calc" VALUE="add">add
<input TYPE="radio" NAME="calc" VALUE="sub"> subtract
<input TYPE="radio" NAME="calc" VALUE="mult">multiply
<input TYPE="radio" NAME="calc" VALUE="div"> divide
<input TYPE="radio" NAME="calc" VALUE="mod"> modulus
</b></font><br><br>
<font face="Tahoma" size="2"><b>Input value 2: <br><INPUT TYPE="text" NAME="two" SIZE=20></b></font></p>
<P><INPUT TYPE="submit" NAME="submit" VALUE="Do Calculation"></p>
</FORM>
</BODY>
</HTML>
|
You didn't even make the script did you??
Parse error: syntax error, unexpected '}' in C:\Program Files\xampp\htdocs\WWW\calculator\Copy of calculator.php on line 22
|

April 10th, 2007, 04:10 PM
|
 |
Valued Member
|
|
Join Date: Sep 2006
Location: Catalonia
Posts: 213
|
|
|
I really don't see much difference, also Johnson's one won't work on server with magic globals OFF (what is more secure).
|

April 10th, 2007, 06:55 PM
|
|
Forum Administrator
|
|
Join Date: Sep 2006
Location: Cincinnati, Ohio USA
Posts: 260
|
|
|
You know, I find it easier to just use the calculator on the computer.... or the one sitting on my desk
|

April 11th, 2007, 12:21 PM
|
 |
Valued Member
|
|
Join Date: Sep 2006
Location: Catalonia
Posts: 213
|
|
Quote:
Originally Posted by Watdaflip
You know, I find it easier to just use the calculator on the computer.... or the one sitting on my desk
|
Me too
|

April 11th, 2007, 03:31 PM
|
|
Member
|
|
Join Date: Apr 2007
Location: Billingham
Posts: 70
|
|
Yeh me to lol and the calculator script shud work i have tested it on my server sevral times to fix a couple of things on it aswell ill show you a live demo if you want ? www.getmepastnow.com/calc.php click that for the demo and i think u find it does work.
|

April 11th, 2007, 03:34 PM
|
|
Member
|
|
Join Date: Apr 2007
Location: Billingham
Posts: 70
|
|
|
And black ice have you uploaded ti to a actual server C:\Program Files\xampp\htdocs\WWW\calculator sounds to me like its on a computer
|

April 11th, 2007, 03:40 PM
|
 |
Valued Member
|
|
Join Date: Sep 2006
Location: Catalonia
Posts: 213
|
|
Quote:
Originally Posted by johnson
And black ice have you uploaded ti to a actual server C:\Program Files\xampp\htdocs\WWW\calculator sounds to me like its on a computer
|
You can run any PHP script like on a server installing Apache with PHP on it. The easiest way to do this is probably XAMPP, that will install Apache, PHP4, PHP5, MySQL and a lot more with a few clicks and configure them automatically.
|

December 7th, 2008, 04:13 PM
|
|
Lurker
|
|
Join Date: Dec 2008
Posts: 1
|
|
|
I can't download the script, is it because I have 0 post ?, I will make this post and try download again.
|

December 9th, 2008, 08:45 AM
|
|
AeonCube Administrator
|
|
Join Date: Aug 2006
Location: United Kingdom
Posts: 1,364
|
|
The download link has now been updated on the first post, sorry about that.
Enjoy!
__________________
HostMediaUK : Low Cost Hosting | Linux PHP Hosting | Windows ColdFusion Hosting | ASP Hosting | Reseller Hosting | Dedicated Servers
AeonCube Networks : Web Design, ColdFusion Development and Web Hosting
|
 |
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 06:09 AM.
|