Macemore
Circumcised pineapples
I made this little calculator, uses GET form method.
Here you go:
Index.html
Calc.php
Made it like 5 seconds
Here you go:
Index.html
HTML:
<form name="input" action="calc.php" method="get">
First Number: <input type="text" name="num1" /><br />
Second Number: <input type="text" name="num2" /><br />
<input type="radio" name="calc" value="d" />Division<br />
<input type="radio" name="calc" value="m" />Multiplaction<br />
<input type="radio" name="calc" value="a" />Add<br />
<input type="radio" name="calc" value="s" />Subtract<br />
<input type="submit" value="Calculate" />
</form>
PHP:
<?
$num1 = $_GET['num1'];
$num2 = $_GET['num2'];
$calc = $_GET['calc'];
if ($calc == 'd') {
$div = $num1 / $num2;
echo $div;
}
if ($calc == 'm') {
$mul = $num1 * $num2;
echo $mul;
}
if ($calc == 'a') {
$add = $num1 + $num2;
echo $add;
}
if ($calc == 's') {
$sub = $num1 - $num2;
echo $sub;
}
?>