Number 1:
Number 2:
Number 1:
Number 2:
<?php
include('../includes/header.php');
error_reporting(E_ALL);
$firstnum = isset($_GET['firstnum']) ? $_GET['firstnum'] : 0;
$secondnum = isset($_GET['secondnum']) ? $_GET['secondnum'] : 0;
//assigning the first and second num values to be their respective counterparts in the GET array. or 0.
?>
<form> <!--form, with no action or method because i wanted to see what would happen.
the method is by default, get, and the action is set to this file-->
<label for="num1">Number 1:</label><br>
<input type="text" id="num1" name="firstnum" value="0"><br>
<label for="num2">Number 2:</label><br>
<input type="text" id="num2" name="secondnum" value="0"><br><br>
<input type="submit" value="Submit">
</form>
<body><p>Number 1: <?php echo $_GET["firstnum"]; ?><br>
Number 2: <?php echo $_GET["secondnum"]; ?></p></body>
<?php
$numsum = $firstnum + $secondnum;
echo("<h3>Sum = $numsum</h3>");
include('../includes/footer.php');
?>