I’m new to PHP, and coding in general. I’m trying to make an online calculator but I can’t get it to “calculate” the numbers. here are my scripts.
this is the form script
“Type in the numbers and the operations you wish to perform”
<form action=”answer.php” method=”REQUEST”>
operation = <input type=”text” name=”operation1″ /><br>
operation = <input type=”text” name=”operation2″ /><br>
operation = <input type=”text” name=”operation3″ /><br>
operation = <input type=”text” name=”operation4″ /><br>
<input type=”submit” value=”Calculate”><br>
</form>
That seems to work at the moment.
Now this script is the answer page.
<?php echo $_REQUEST[“1”]; ?>
<?php echo $
<?php echo $_REQUEST[“2”]; ?>
<?php echo $
<?php echo $_REQUEST[“3”]; ?>
<?php echo $
<?php echo $_REQUEST[“4”]; ?>
<?php echo $
<?php echo $_REQUEST[“5”]; ?>
= (insert code to calculate numbers here)
What do I have to do to make this work? The coding before the equal sign is there to show the problem, after the equal sign is where I want the answer to appear. REMEMBER, I’m only a few hours into this so if my script is COMPLETELY wrong, don’t laugh.