New to pHp programming. This assignment is for one of my college classes. I don't even know if the pHp that I started is correct.
Using XAMPP
Problem: I'm trying to create a webpage that defines a form that allows you to enter 4 test scores into it and then display the total of those 4 scores.
Here is the code that I currently have:
Using XAMPP
Problem: I'm trying to create a webpage that defines a form that allows you to enter 4 test scores into it and then display the total of those 4 scores.
Here is the code that I currently have:
Code:
<?php
// get the data from the form
$test_score1 = filter_input(INPUT_POST, 'test_score1');
$test_score2 = filter_input(INPUT_POST, 'test_score2');
$test_score3 = filter_input(INPUT_POST, 'test_score3');
$test_score4 = filter_input(INPUT_POST, 'test_score4');
// calculate the 4 total test scores
$total = $test_score1 + test_score2 + test_score3 + test_score4
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="TestScore.css">
<title>Test Score Calculator</title>
<body>
<center><form action="display_exam.php" method="post">
<div id="data">
<label>Test Score 1:</label>
<input type="text" name="test_score1"><br>
<label>Test Score 2:</label>
<input type="text" name"test_score2"><br>
<label>Test Score 3:</label>
<input type="text" name"test_score3"><br>
<label>Test Score 4:</label>
<input type="text" name"test_score4"><br>
</div>
<div id="buttons">
<label> </label>
<input type="submit" value"Calculate Test Scores"><br>
</div>
</form></center>