PHP coding help please URGENT!?

Jordan K

New member
Hi, i'm very very very new to it. I don't have a clue how to do anything really.
What i'm wanting to create is a grade calculator.

This is the code i have at the moment:

<?php

$result = $_POST[1] + $_POST[2] + $_POST[3] + $_POST[4] + $_POST[5] + $_POST[6] + $_POST[7] + $_POST[8] + $_POST[9] + $_POST[10] + $_POST[11] + $_POST[12] + $_POST[13] + $_POST[14] + $_POST[15] + $_POST[16] + $_POST[17] + $_POST[18];

echo "<title>Grade Result</title>";
echo "<p>Your grade result is: $result</p>";
?>

and basically this means that when people enter the numbers into the form boxes and they click submit it will add all the numbers and give them a result.

In my case i want it to do this, however the grade calculator is based on grades so people would be entering letters into the text box for each subject e.g. " A " or " B " but each letter represents a score like A = 15 points and B= 10 points and i want the code so the user can enter letters into the form and when they click submit it will give them the total points for all the grades they've entered.

Sorry i think i've confused you by over explaining it but i suppose what i'm saying is. How do i tell it that the letter A = 15 points and it will add it up.
 
Back
Top