[PHP[R2]]Advanced-Coded Calculator[Made by SG]

Status
Not open for further replies.
Nov 23, 2010
307
2
Hey people!!
Finally after MUCH errors and problems Advanced-coded Calculator R2.
Hope you like it:)

---->CALCULATOR<----
Calculator have ONLY 1% bugs , you may find them and post in comment or find and fix , also post in comment.
Calculator is not coded in 1 file for "select" problems

index.php :
PHP:
<html>
	<head>
		<title>Calculator R2</title>
	</head>
	<body>
		<style type="text/css">
		body {
		background-color: darkgreen;
		background-repeat: repeat;
		}
		</style>
		<font color="orange"><b><h2>Calculator</h2><br>
		Welcome to Calculator Coded by StronGCoder.<br>
		Today is <?php echo date("d/m/y"); ?>.<br>
		Thanks for vising us<br><br>
		<h3><b>Choose a way to calculate</b></h3></font>
		<br><br>
		<big><font color="black">NOTICE: All operators are "+"  but that doesn't mean it can be ONLY "+" .</big></font>
		<br><br>
		<form action="./index.php" method="post">
		<select name="wTc">
		<option>First Number + Second Number</option>
		<option>( First Number + Second Number ) + ( Third number + Fourth number )</option>
		<option>First Number + ( Second Number + Third Number )</option>
		</select>
		<br><br>
		<input type="submit" value="Go on...">
		<?php
		if($_POST["wTc"] == "First Number + Second Number")
		{
		?>
		<br><br>
		<a href="./results_way1.php"><font color="orange">Choose this way to calculate</font></a>
		<?php 
		}
		?>
		<?php
		if($_POST["wTc"] == "( First Number + Second Number ) + ( Third number + Fourth number )")
		{
		?>
		<br><br>
		<a href="./results_way2.php"><font color="orange">Choose this way to calculate</font></a>
		<?php 
		}
		?>
		<?php
		if($_POST["wTc"] == "First Number + ( Second Number + Third Number )")
		{
		?>
		<br><br>
		<a href="./results_way3.php"><font color="orange">Choose this way to calculate</font></a>
		<?php 
		}
		?>
		</b>
		</form>
	</body>
</html>

results_way1.php:
PHP:
<html>
	<head>
		<title>Calculator Way 1</title>
	</head>
	<body>
		<style type="text/css">
		body {
		background-color: darkgreen;
		background-repeat: repeat;
		}
		</style>
		<b>
		<font color="orange">
		<form action="results_way1.php" method="post">
		First number: <input type="number" name="x"><br>
		Operator: <input type="operator" name="oper"><br>
		Second Number: <input type="number" name="y"><br>
		<br><input type="submit" value="Go on..."><br>
		<?php
		if(!$_POST["x"])
		{
		echo "<br><br>Fill the first number please";
		}
		if(!$_POST["oper"])
		{
		echo "<br><br>Fill the correct operator please";
		}
		if(!$_POST["y"])
		{
		echo "<br><br>Fill the second number please";
		}
		if($_POST["oper"] == "+")
		{
		echo "<br><br>";
		echo  $_POST["x"] . " + " . $_POST["y"];
		echo " = ";
		echo $_POST["x"] + $_POST["y"];
		}
		if($_POST["oper"] == "-")
		{
		echo "<br><br>";
		echo  $_POST["x"] . " - " . $_POST["y"];
		echo " = ";
		echo $_POST["x"] - $_POST["y"];
		}
		if($_POST["oper"] == "*")
		{
		echo "<br><br>";
		echo  $_POST["x"] . " * " . $_POST["y"];
		echo " = ";
		echo $_POST["x"] * $_POST["y"];
		}
		if($_POST["oper"] == "/")
		{
		echo "<br><br>";
		echo  $_POST["x"] . " / " . $_POST["y"];
		echo " = ";
		echo $_POST["x"] / $_POST["y"];
		}
		?>
		</b>
		</font>
		</form>
	</body>
</html>

results_way2.php:
PHP:
<html>
	<head>
		<title>Calculator Way 2</title>
	</head>
	<body>
		<style type="text/css">
		body {
		background-color: darkgreen;
		background-repeat: repeat;
		}
		</style>
		<font color="orange">
		<b>
		<form action="results_way2.php" method="post">
		( First number: <input type="number" name="x"><br>
		First Operator: <input type="operator" name="oper"><br>
		Second number:   <input type="number" name="y"> ) <br>
		Second Operator:  <input type="operator" name="oper2"><br>
		( Third number:  <input type="number" name="x2"><br>
		Third Operator:  <input type="operator" name="oper3"><br>
		Fourth number:  <input type="number" name="y2"> )<br>
		<br><input type="submit" value="Go on..."><br><br>
		<?php
		if(!$_POST["x"])
		{
		echo "<br><br>Fill the first number please<br><br>";
		}
		if(!$_POST["oper"])
		{
		echo "<br><br>Fill the first operator please<br><br>";
		}
		if(!$_POST["y"])
		{
		echo "<br><br>Fill the second number please<br><br>";
		}
		if(!$_POST["oper2"])
		{
		echo "<br><br>Fill the second operator please<br><br>";
		}
		if(!$_POST["x2"])
		{
		echo "<br><br>Fill the third number please<br><br>";
		}
		if(!$_POST["oper3"])
		{
		echo "<br><br>Fill the third operator please<br><br>";
		}
		if(!$_POST["y2"])
		{
		echo "<br><br>Fill the fourth number please<br><br>";
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "+" and $_POST["oper3"] == "+")
		{
		echo $_POST["x"] . " + " . $_POST["y"] . " + " . $_POST["x2"] . " + " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] + $_POST["y"] ) + ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "+" and $_POST["oper3"] == "-")
		{
		echo $_POST["x"] . " + " . $_POST["y"] . " + " . $_POST["x2"] . " - " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] + $_POST["y"] ) + ( $_POST["x2"] - $_POST["y2"] );
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "+" and $_POST["oper3"] == "*")
		{
		echo $_POST["x"] . " + " . $_POST["y"] . " + " . $_POST["x2"] . " * " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] + $_POST["y"] ) + ( $_POST["x2"] * $_POST["y2"] );
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "+" and $_POST["oper3"] == "/")
		{
		echo $_POST["x"] . " + " . $_POST["y"] . " + " . $_POST["x2"] . " / " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] + $_POST["y"] ) + ( $_POST["x2"] / $_POST["y2"] );
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "-" and $_POST["oper3"] == "+")
		{
		echo $_POST["x"] . " + " . $_POST["y"] . " - " . $_POST["x2"] . " + " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] + $_POST["y"] ) - ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "*" and $_POST["oper3"] == "+")
		{
		echo $_POST["x"] . " + " . $_POST["y"] . " * " . $_POST["x2"] . " + " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] + $_POST["y"] ) * ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "/" and $_POST["oper3"] == "+")
		{
		echo $_POST["x"] . " + " . $_POST["y"] . " / " . $_POST["x2"] . " + " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] + $_POST["y"] ) / ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "-" and $_POST["oper3"] == "-")
		{
		echo $_POST["x"] . " + " . $_POST["y"] . " - " . $_POST["x2"] . " - " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] + $_POST["y"] ) - ( $_POST["x2"] - $_POST["y2"] );
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "-" and $_POST["oper3"] == "*")
		{
		echo $_POST["x"] . " + " . $_POST["y"] . " - " . $_POST["x2"] . " * " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] + $_POST["y"] ) - ( $_POST["x2"] * $_POST["y2"] );
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "-" and $_POST["oper3"] == "/")
		{
		echo $_POST["x"] . " + " . $_POST["y"] . " - " . $_POST["x2"] . " / " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] + $_POST["y"] ) + ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "*" and $_POST["oper3"] == "-")
		{
		echo $_POST["x"] . " + " . $_POST["y"] . " * " . $_POST["x2"] . " - " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] + $_POST["y"] ) * ( $_POST["x2"] - $_POST["y2"] );
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "*" and $_POST["oper3"] == "*")
		{
		echo $_POST["x"] . " + " . $_POST["y"] . " * " . $_POST["x2"] . " * " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] + $_POST["y"] ) * ( $_POST["x2"] * $_POST["y2"] );
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "*" and $_POST["oper3"] == "/")
		{
		echo $_POST["x"] . " + " . $_POST["y"] . " * " . $_POST["x2"] . " / " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] + $_POST["y"] ) * ( $_POST["x2"] / $_POST["y2"] );
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "/" and $_POST["oper3"] == "-")
		{
		echo $_POST["x"] . " + " . $_POST["y"] . " / " . $_POST["x2"] . " - " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] + $_POST["y"] ) / ( $_POST["x2"] - $_POST["y2"] );
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "/" and $_POST["oper3"] == "*")
		{
		echo $_POST["x"] . " + " . $_POST["y"] . " / " . $_POST["x2"] . " * " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] + $_POST["y"] ) / ( $_POST["x2"] * $_POST["y2"] );
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "/" and $_POST["oper3"] == "/")
		{
		echo $_POST["x"] . " + " . $_POST["y"] . " / " . $_POST["x2"] . " / " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] + $_POST["y"] ) / ( $_POST["x2"] / $_POST["y2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "+" and $_POST["oper3"] == "+")
		{
		echo $_POST["x"] . " - " . $_POST["y"] . " + " . $_POST["x2"] . " + " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] - $_POST["y"] ) + ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "+" and $_POST["oper3"] == "-")
		{
		echo $_POST["x"] . " - " . $_POST["y"] . " + " . $_POST["x2"] . " - " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] - $_POST["y"] ) + ( $_POST["x2"] - $_POST["y2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "+" and $_POST["oper3"] == "*")
		{
		echo $_POST["x"] . " - " . $_POST["y"] . " + " . $_POST["x2"] . " * " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] - $_POST["y"] ) + ( $_POST["x2"] * $_POST["y2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "+" and $_POST["oper3"] == "/")
		{
		echo $_POST["x"] . " - " . $_POST["y"] . " + " . $_POST["x2"] . " / " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] - $_POST["y"] ) + ( $_POST["x2"] / $_POST["y2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "-" and $_POST["oper3"] == "+")
		{
		echo $_POST["x"] . " - " . $_POST["y"] . " - " . $_POST["x2"] . " + " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] - $_POST["y"] ) - ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "*" and $_POST["oper3"] == "+")
		{
		echo $_POST["x"] . " - " . $_POST["y"] . " * " . $_POST["x2"] . " + " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] - $_POST["y"] ) * ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "/" and $_POST["oper3"] == "+")
		{
		echo $_POST["x"] . " - " . $_POST["y"] . " / " . $_POST["x2"] . " + " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] - $_POST["y"] ) / ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "-" and $_POST["oper3"] == "-")
		{
		echo $_POST["x"] . " - " . $_POST["y"] . " - " . $_POST["x2"] . " - " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] - $_POST["y"] ) - ( $_POST["x2"] - $_POST["y2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "-" and $_POST["oper3"] == "*")
		{
		echo $_POST["x"] . " - " . $_POST["y"] . " - " . $_POST["x2"] . " * " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] - $_POST["y"] ) - ( $_POST["x2"] * $_POST["y2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "-" and $_POST["oper3"] == "/")
		{
		echo $_POST["x"] . " - " . $_POST["y"] . " - " . $_POST["x2"] . " / " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] - $_POST["y"] ) + ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "*" and $_POST["oper3"] == "-")
		{
		echo $_POST["x"] . " - " . $_POST["y"] . " * " . $_POST["x2"] . " - " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] - $_POST["y"] ) * ( $_POST["x2"] - $_POST["y2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "*" and $_POST["oper3"] == "*")
		{
		echo $_POST["x"] . " - " . $_POST["y"] . " * " . $_POST["x2"] . " * " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] - $_POST["y"] ) * ( $_POST["x2"] * $_POST["y2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "*" and $_POST["oper3"] == "/")
		{
		echo $_POST["x"] . " - " . $_POST["y"] . " * " . $_POST["x2"] . " / " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] - $_POST["y"] ) * ( $_POST["x2"] / $_POST["y2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "/" and $_POST["oper3"] == "-")
		{
		echo $_POST["x"] . " - " . $_POST["y"] . " / " . $_POST["x2"] . " - " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] - $_POST["y"] ) / ( $_POST["x2"] - $_POST["y2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "/" and $_POST["oper3"] == "*")
		{
		echo $_POST["x"] . " - " . $_POST["y"] . " / " . $_POST["x2"] . " * " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] - $_POST["y"] ) / ( $_POST["x2"] * $_POST["y2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "/" and $_POST["oper3"] == "/")
		{
		echo $_POST["x"] . " - " . $_POST["y"] . " / " . $_POST["x2"] . " / " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] - $_POST["y"] ) / ( $_POST["x2"] / $_POST["y2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "+" and $_POST["oper3"] == "+")
		{
		echo $_POST["x"] . " * " . $_POST["y"] . " + " . $_POST["x2"] . " + " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] * $_POST["y"] ) + ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "+" and $_POST["oper3"] == "-")
		{
		echo $_POST["x"] . " * " . $_POST["y"] . " + " . $_POST["x2"] . " - " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] * $_POST["y"] ) + ( $_POST["x2"] - $_POST["y2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "+" and $_POST["oper3"] == "*")
		{
		echo $_POST["x"] . " * " . $_POST["y"] . " + " . $_POST["x2"] . " * " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] * $_POST["y"] ) + ( $_POST["x2"] * $_POST["y2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "+" and $_POST["oper3"] == "/")
		{
		echo $_POST["x"] . " * " . $_POST["y"] . " + " . $_POST["x2"] . " / " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] * $_POST["y"] ) + ( $_POST["x2"] / $_POST["y2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "-" and $_POST["oper3"] == "+")
		{
		echo $_POST["x"] . " * " . $_POST["y"] . " - " . $_POST["x2"] . " + " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] * $_POST["y"] ) - ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "*" and $_POST["oper3"] == "+")
		{
		echo $_POST["x"] . " * " . $_POST["y"] . " * " . $_POST["x2"] . " + " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] * $_POST["y"] ) * ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "/" and $_POST["oper3"] == "+")
		{
		echo $_POST["x"] . " * " . $_POST["y"] . " / " . $_POST["x2"] . " + " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] * $_POST["y"] ) / ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "-" and $_POST["oper3"] == "-")
		{
		echo $_POST["x"] . " * " . $_POST["y"] . " - " . $_POST["x2"] . " - " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] * $_POST["y"] ) - ( $_POST["x2"] - $_POST["y2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "-" and $_POST["oper3"] == "*")
		{
		echo $_POST["x"] . " * " . $_POST["y"] . " - " . $_POST["x2"] . " * " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] * $_POST["y"] ) - ( $_POST["x2"] * $_POST["y2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "-" and $_POST["oper3"] == "/")
		{
		echo $_POST["x"] . " * " . $_POST["y"] . " - " . $_POST["x2"] . " / " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] * $_POST["y"] ) + ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "*" and $_POST["oper3"] == "-")
		{
		echo $_POST["x"] . " * " . $_POST["y"] . " * " . $_POST["x2"] . " - " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] * $_POST["y"] ) * ( $_POST["x2"] - $_POST["y2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "*" and $_POST["oper3"] == "*")
		{
		echo $_POST["x"] . " * " . $_POST["y"] . " * " . $_POST["x2"] . " * " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] * $_POST["y"] ) * ( $_POST["x2"] * $_POST["y2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "*" and $_POST["oper3"] == "/")
		{
		echo $_POST["x"] . " * " . $_POST["y"] . " * " . $_POST["x2"] . " / " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] * $_POST["y"] ) * ( $_POST["x2"] / $_POST["y2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "/" and $_POST["oper3"] == "-")
		{
		echo $_POST["x"] . " * " . $_POST["y"] . " / " . $_POST["x2"] . " - " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] * $_POST["y"] ) / ( $_POST["x2"] - $_POST["y2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "/" and $_POST["oper3"] == "*")
		{
		echo $_POST["x"] . " * " . $_POST["y"] . " / " . $_POST["x2"] . " * " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] * $_POST["y"] ) / ( $_POST["x2"] * $_POST["y2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "/" and $_POST["oper3"] == "/")
		{
		echo $_POST["x"] . " * " . $_POST["y"] . " / " . $_POST["x2"] . " / " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] * $_POST["y"] ) / ( $_POST["x2"] / $_POST["y2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "+" and $_POST["oper3"] == "+")
		{
		echo $_POST["x"] . " / " . $_POST["y"] . " + " . $_POST["x2"] . " + " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] / $_POST["y"] ) + ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "+" and $_POST["oper3"] == "-")
		{
		echo $_POST["x"] . " / " . $_POST["y"] . " + " . $_POST["x2"] . " - " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] / $_POST["y"] ) + ( $_POST["x2"] - $_POST["y2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "+" and $_POST["oper3"] == "*")
		{
		echo $_POST["x"] . " / " . $_POST["y"] . " + " . $_POST["x2"] . " * " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] / $_POST["y"] ) + ( $_POST["x2"] * $_POST["y2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "+" and $_POST["oper3"] == "/")
		{
		echo $_POST["x"] . " / " . $_POST["y"] . " + " . $_POST["x2"] . " / " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] / $_POST["y"] ) + ( $_POST["x2"] / $_POST["y2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "-" and $_POST["oper3"] == "+")
		{
		echo $_POST["x"] . " / " . $_POST["y"] . " - " . $_POST["x2"] . " + " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] / $_POST["y"] ) - ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "*" and $_POST["oper3"] == "+")
		{
		echo $_POST["x"] . " / " . $_POST["y"] . " * " . $_POST["x2"] . " + " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] / $_POST["y"] ) * ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "/" and $_POST["oper3"] == "+")
		{
		echo $_POST["x"] . " / " . $_POST["y"] . " / " . $_POST["x2"] . " + " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] / $_POST["y"] ) / ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "-" and $_POST["oper3"] == "-")
		{
		echo $_POST["x"] . " / " . $_POST["y"] . " - " . $_POST["x2"] . " - " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] / $_POST["y"] ) - ( $_POST["x2"] - $_POST["y2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "-" and $_POST["oper3"] == "*")
		{
		echo $_POST["x"] . " / " . $_POST["y"] . " - " . $_POST["x2"] . " * " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] / $_POST["y"] ) - ( $_POST["x2"] * $_POST["y2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "-" and $_POST["oper3"] == "/")
		{
		echo $_POST["x"] . " / " . $_POST["y"] . " - " . $_POST["x2"] . " / " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] / $_POST["y"] ) + ( $_POST["x2"] + $_POST["y2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "*" and $_POST["oper3"] == "-")
		{
		echo $_POST["x"] . " / " . $_POST["y"] . " * " . $_POST["x2"] . " - " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] / $_POST["y"] ) * ( $_POST["x2"] - $_POST["y2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "*" and $_POST["oper3"] == "*")
		{
		echo $_POST["x"] . " / " . $_POST["y"] . " * " . $_POST["x2"] . " * " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] / $_POST["y"] ) * ( $_POST["x2"] * $_POST["y2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "*" and $_POST["oper3"] == "/")
		{
		echo $_POST["x"] . " / " . $_POST["y"] . " * " . $_POST["x2"] . " / " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] / $_POST["y"] ) * ( $_POST["x2"] / $_POST["y2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "/" and $_POST["oper3"] == "-")
		{
		echo $_POST["x"] . " / " . $_POST["y"] . " / " . $_POST["x2"] . " - " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] / $_POST["y"] ) / ( $_POST["x2"] - $_POST["y2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "/" and $_POST["oper3"] == "*")
		{
		echo $_POST["x"] . " / " . $_POST["y"] . " / " . $_POST["x2"] . " * " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] / $_POST["y"] ) / ( $_POST["x2"] * $_POST["y2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "/" and $_POST["oper3"] == "/")
		{
		echo $_POST["x"] . " / " . $_POST["y"] . " / " . $_POST["x2"] . " / " . $_POST["y2"];
		echo " = ";
		echo ( $_POST["x"] / $_POST["y"] ) / ( $_POST["x2"] / $_POST["y2"] );
		}
		?>

results_way3.php:
PHP:
<html>
	<head>
		<title>Calculator Way 3</title>
	</head>
	<body>
		<style type="text/css">
		body {
		background-color: darkgreen;
		background-repeat: repeat;
		}
		</style>
		<b>
		<font color="orange">
		<form action="results_way3.php" method="post">
		First number: <input type="number" name="x"><br>
		First Operator: <input type="operator" name="oper"><br>
		( Second Number: <input type="number" name="y"><br>
		Second Operator: <input type="operator" name="oper2"><br>
		Third Number: <input type="number" name="x2"><br>
		<br><input type="submit" value="Go on..."><br>
		<?php
		if(!$_POST["x"])
		{
		echo "<br><br>Fill the first number please";
		}
		if(!$_POST["oper"])
		{
		echo "<br><br>Fill the first operator please";
		}
		if(!$_POST["y"])
		{
		echo "<br><br>Fill the second number please";
		}
		if(!$_POST["oper2"])
		{
		echo "<br><br>Fill the second operator please";
		}
		if(!$_POST["x2"])
		{
		echo "<br><br>Fill the third number please";
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "+")
		{
		echo "<br><br>";
		echo $_POST["x"] . " + " . $_POST["y"] . " + " . $_POST["x2"];
		echo " = ";
		echo $_POST["x"] + ( $_POST["y"] + $_POST["x2"] );
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "-")
		{
		echo "<br><br>";
		echo $_POST["x"] . " + " . $_POST["y"] . " - " . $_POST["x2"];
		echo " = ";
		echo $_POST["x"] + ( $_POST["y"] - $_POST["x2"] );
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "*")
		{
		echo "<br><br>";
		echo $_POST["x"] . " + " . $_POST["y"] . " * " . $_POST["x2"];
		echo " = ";
		echo $_POST["x"] + ( $_POST["y"] * $_POST["x2"] );
		}
		if($_POST["oper"] == "+" and $_POST["oper2"] == "/")
		{
		echo "<br><br>";
		echo $_POST["x"] . " + " . $_POST["y"] . " / " . $_POST["x2"];
		echo " = ";
		echo $_POST["x"] + ( $_POST["y"] / $_POST["x2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "+")
		{
		echo "<br><br>";
		echo $_POST["x"] . " - " . $_POST["y"] . " + " . $_POST["x2"];
		echo " = ";
		echo $_POST["x"] - ( $_POST["y"] + $_POST["x2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "-")
		{
		echo "<br><br>";
		echo $_POST["x"] . " - " . $_POST["y"] . " - " . $_POST["x2"];
		echo " = ";
		echo $_POST["x"] - ( $_POST["y"] - $_POST["x2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "*")
		{
		echo "<br><br>";
		echo $_POST["x"] . " - " . $_POST["y"] . " * " . $_POST["x2"];
		echo " = ";
		echo $_POST["x"] - ( $_POST["y"] * $_POST["x2"] );
		}
		if($_POST["oper"] == "-" and $_POST["oper2"] == "/")
		{
		echo "<br><br>";
		echo $_POST["x"] . " - " . $_POST["y"] . " / " . $_POST["x2"];
		echo " = ";
		echo $_POST["x"] - ( $_POST["y"] / $_POST["x2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "+")
		{
		echo "<br><br>";
		echo $_POST["x"] . " * " . $_POST["y"] . " + " . $_POST["x2"];
		echo " = ";
		echo $_POST["x"] * ( $_POST["y"] + $_POST["x2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "-")
		{
		echo "<br><br>";
		echo $_POST["x"] . " * " . $_POST["y"] . " - " . $_POST["x2"];
		echo " = ";
		echo $_POST["x"] * ( $_POST["y"] - $_POST["x2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "*")
		{
		echo "<br><br>";
		echo $_POST["x"] . " * " . $_POST["y"] . " * " . $_POST["x2"];
		echo " = ";
		echo $_POST["x"] * ( $_POST["y"] * $_POST["x2"] );
		}
		if($_POST["oper"] == "*" and $_POST["oper2"] == "/")
		{
		echo "<br><br>";
		echo $_POST["x"] . " * " . $_POST["y"] . " / " . $_POST["x2"];
		echo " = ";
		echo $_POST["x"] * ( $_POST["y"] / $_POST["x2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "+")
		{
		echo "<br><br>";
		echo $_POST["x"] . " / " . $_POST["y"] . " + " . $_POST["x2"];
		echo " = ";
		echo $_POST["x"] / ( $_POST["y"] + $_POST["x2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "-")
		{
		echo "<br><br>";
		echo $_POST["x"] . " / " . $_POST["y"] . " - " . $_POST["x2"];
		echo " = ";
		echo $_POST["x"] / ( $_POST["y"] - $_POST["x2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "*")
		{
		echo "<br><br>";
		echo $_POST["x"] . " / " . $_POST["y"] . " * " . $_POST["x2"];
		echo " = ";
		echo $_POST["x"] / ( $_POST["y"] * $_POST["x2"] );
		}
		if($_POST["oper"] == "/" and $_POST["oper2"] == "/")
		{
		echo "<br><br>";
		echo $_POST["x"] . " / " . $_POST["y"] . " / " . $_POST["x2"];
		echo " = ";
		echo $_POST["x"] / ( $_POST["y"] / $_POST["x2"] );
		}
		?>
		</b>
		</font>
		</form>
	</body>
</html>

No screenies , PHP code tells all what it does have in

Rate and feel free to thanks me :p
Notice:
do not comment if you wanna flame
Feel free to make fixes
do not count this as your work

Credits:
Me-strongcoder - 100% :p
THANKS!!!
StronGCoder
 
Nov 23, 2010
307
2
Ehm i wanted to code something that would be more nice for peoples placing the real coded-calculator

OFT; i am worried so much , as many peoples said : "OMG I CANT WAIT FOR V2(R2)" and now only 1 comment.
 

Bazinga

Posting Freak
Aug 3, 2010
819
54
Nice release, but.. Who actually needs a Calculator Coded when it's in 'Accessories' on everyone's Computer. XD
Agreed, and who said, 'OMG I CANT WAIT FOR V2(R2)' becuase I don't rememer anyone saying that. It's still nicely coded etc I just think it was a bit pointless ;P
 

Kaz

BooYah
Staff member
Nov 16, 2010
3,064
1,025
Nice Idea but im going to have to agree with CamShy

Nobody has said 'OMG I CANT WAIT FOR V2(R2)' in this thread -
 
Nov 23, 2010
307
2
Kay ,



different comments :
camshy said:
Nice release, and it works: 8/10
now changed the mind

said cant wait:
You've received a Thank's. Cannot wait for V2... I agree with someone that stated before add a background
and yeah .. some peoples in my MSN said that , and other peoples liked the simple one , so thats a good point :)!!

i dont want to argue with anyone , i am just doing a proof !

>>BACK TO THE TOPIC<<
 
Status
Not open for further replies.

Users who are viewing this thread

Top