<?php
all of the code runs well except the last if statement
$residency = substr(filter_input(INPUT_POST, 'residency', FILTER_SANITIZE_STRING),0,1);
$lower = substr(filter_input(INPUT_POST, 'lower', FILTER_SANITIZE_STRING),0,1);
$upper = substr(filter_input(INPUT_POST, 'upper', FILTER_SANITIZE_STRING),0,2);
$links= substr (filter_input(INPUT_POST, 'faid', FILTER_SANITIZE_STRING),0,1);
if ($residency == 1)
{
$residency = "in-district";
$tuition = ($lower * 96) + ($upper * 200) + (($lower + $upper) * 22) + 91;
}
elseif ($residency == 2)
{
$residency = "out-of-district";
$tuition = ($lower * 166) + ($upper * 265) + (($lower + $upper) * 22) + 91;
}
elseif ($residency == 3)
{
$residency = "Out-of-State/International";
$tuition = ($lower * 240) + ($upper *350) + (($lower + $upper) * 22) + 91;
}
{
echo "<p>Total $residency tuition cost of $lower 100-200 credits hours and $upper 300-400 credits is: $" . number_format($tuition,2) . "</p>";
}
the page asks the user if they want the links, from the drop down menu they can click yes or no, but the links below appear even if the user clicks no
if ($links == "yes")
{
echo"<p>Links</p>";
echo"<p><a href=\"https://www.yahoo.com\">Yahoo</a></p>";
echo"<p><a href=\"https://www.google.com\">Google</a></p>";
}
?>
Aucun commentaire:
Enregistrer un commentaire