The teacher asks for the Impossible
Posted: Mon Jun 05, 2006 11:43 am
Howdy folk. I have a very humble request...
Im taking a computer sciences course here at school. The teacher gave us a crash course of PHP in 3 classes. Needless to say, this was hardly enough and Im stil left flying blind. He gave us a very, very hard assignment. We must code a calculator. Now, I know plenty are available on the net, However, not this kind. Every other calculator I find is usually a 2 box calculator you type the numbers in and select the operator, then push submt. This calculator must be like an actual calculator, with the numbers you push adding onto a big string of them and then you push the operator and then you push the second numbers and then equals. It must look like a real calculator. I have uploaded my code to a txt document on geocities, Which is linked http://www.geocities.com/raptor_aximili/phpcalc.txt
Just view source that, and that will be my entire PHP code.
Im lost >.< Please help!
Edit: PHP Code below aswell
Im taking a computer sciences course here at school. The teacher gave us a crash course of PHP in 3 classes. Needless to say, this was hardly enough and Im stil left flying blind. He gave us a very, very hard assignment. We must code a calculator. Now, I know plenty are available on the net, However, not this kind. Every other calculator I find is usually a 2 box calculator you type the numbers in and select the operator, then push submt. This calculator must be like an actual calculator, with the numbers you push adding onto a big string of them and then you push the operator and then you push the second numbers and then equals. It must look like a real calculator. I have uploaded my code to a txt document on geocities, Which is linked http://www.geocities.com/raptor_aximili/phpcalc.txt
Just view source that, and that will be my entire PHP code.
Im lost >.< Please help!
Edit: PHP Code below aswell
Code: Select all
<HTML>
<HEAD>
<TITLE>Calculatron 5000</TITLE>
<LINK
REL = StyleSheet
HREF ="style.css"
Type ="text/css"
title ="Screen Style"
Media ="screen" >
</head>
<BODY>
<form Method="post" Action="caltest.php">
<input type="text" name="" size="20">
<br>
<br>
<FORM Method="post"
action="<?php echo $_SERVER ['PHP_Self']; ?>">
<button type="Submit"
Value="7"
name="number"
class="mybuttons"> 7
</button>
<input type="Hidden"
name="curr_Num"
Value="<?php echo $curr_num; ?> "?>
<FORM Method="post"
action="<?php echo $_SERVER ['PHP_Self']; ?>">
<button type="Submit"
Value="8"
name="number"
class="mybuttons"> 8
</button>
<input type="Hidden"
name="curr_Num"
Value="<?php echo $curr_num; ?> "?>
<FORM Method="post"
action="<?php echo $_SERVER ['PHP_Self']; ?>">
<button type="Submit"
Value="9"
name="number"
class="mybuttons"> 9
</button>
<input type="Hidden"
name="curr_Num"
Value="<?php echo $curr_num; ?> "?>
<FORM Method="post"
action="<?php echo $_SERVER ['PHP_Self']; ?>">
<button type="Submit"
Value="/"
name="number"
class="mybuttons"> /
</button>
<input type="Hidden"
name="curr_Num"
Value="<?php echo $curr_num; ?> "?>
<br>
<br>
<FORM Method="post"
action="<?php echo $_SERVER ['PHP_Self']; ?>">
<button type="Submit"
Value="4"
name="number"
class="mybuttons"> 4
</button>
<input type="Hidden"
name="curr_Num"
Value="<?php echo $curr_num; ?> "?>
<FORM Method="post"
action="<?php echo $_SERVER ['PHP_Self']; ?>">
<button type="Submit"
Value="5"
name="number"
class="mybuttons"> 5
</button>
<input type="Hidden"
name="curr_Num"
Value="<?php echo $curr_num; ?> "?>
<FORM Method="post"
action="<?php echo $_SERVER ['PHP_Self']; ?>">
<button type="Submit"
Value="6"
name="number"
class="mybuttons"> 6
</button>
<input type="Hidden"
name="curr_Num"
Value="<?php echo $curr_num; ?> "?>
<FORM Method="post"
action="<?php echo $_SERVER ['PHP_Self']; ?>">
<button type="Submit"
Value="*"
name="number"
class="mybuttons"> *
</button>
<input type="Hidden"
name="curr_Num"
Value="<?php echo $curr_num; ?> "?>
<br>
<FORM Method="post"
action="<?php echo $_SERVER ['PHP_Self']; ?>">
<button type="Submit"
Value="1"
name="number"
class="mybuttons"> 1
</button>
<input type="Hidden"
name="curr_Num"
Value="<?php echo $curr_num; ?> "?>
<FORM Method="post"
action="<?php echo $_SERVER ['PHP_Self']; ?>">
<button type="Submit"
Value="2"
name="number"
class="mybuttons"> 2
</button>
<input type="Hidden"
name="curr_Num"
Value="<?php echo $curr_num; ?> "?>
<FORM Method="post"
action="<?php echo $_SERVER ['PHP_Self']; ?>">
<button type="Submit"
Value="3"
name="number"
class="mybuttons"> 3
</button>
<input type="Hidden"
name="curr_Num"
Value="<?php echo $curr_num; ?> "?>
<FORM Method="post"
action="<?php echo $_SERVER ['PHP_Self']; ?>">
<button type="Submit"
Value="-"
name="number"
class="mybuttons"> -
</button>
<input type="Hidden"
name="curr_Num"
Value="<?php echo $curr_num; ?> "?>
<br>
<input type="button" value="0"class="button-width">
<input type="button" value="C"class="button-width">
<input type="button" value="+"class="button-width">
<input type="button" value="="class="button-width">