I am trying to make a calculator to calculate your age in dog years, the following is the code I have so far, minus the html portion of it
<?php
if (!isset($_POST['your_age']) ) {
header("Location: dog_form.html");
exit;
}
if ($_POST['your_age'] == "your_age") {
$result = ($_POST['your_age'] *7;
if ($_POST['your_age'] >= 100 && $_POST['your_age'] <= 199) {
$result = "An Old Dog";
}
else if
($_POST['your_age'] >= 200 && $_POST['your_age'] <= 299) {
$result = "Wicked Old Dog";
}
else if
($_POST['your_age'] >= 300) {
$result = "Ancient Dog";
}
?>
<HTML>
<HEAD>
<TITLE>Calculation Result</TITLE>
</HEAD>
<BODY><H2><center>
<P>The result of the calculation is: <?php echo $result; ?></p>
</BODY></H2></center>
</HTML>
I am having trouble multiplying the Your_age variable by 7 which would be the dog years compared to human years. Anyway, i am kind of a newbie at this and have been sitting here for a few hours, struggling with where to place it or how to go about doing it.
It needs to multiply by 7 and then be printed to the screen upon hitting submit.
Any input would be greatly appreciated.