HTML Code:
<form action="process.php" method="post"> <input type="text" name="number1"> <input type="text" name="number2"> </form>
okay theres a form with just one text field. if you look at the first line, action is that page that the form data is being sent to. and method is either get or post. get means itll show the variables and thier names in the next pages url post wont do that.
PHP Code:
<?php
echo $_POST[number1] + $_POST[number2];
?>
echo simply outputs text to the browser. you could simply just do echo $number1; but if you dont have globals or something turned on in your php settings that script wont work. if you had your form set to get, then you would use echo $_GET[number1];