<?php
if ($scale == "celcius")
{print "<table border><tr><th colspan=2> Conversion Results</th></tr><tr><td>$degree</td><td>celsius</td></tr>";
$c_2_f = $degree*9/5+32;
print "<tr><td>$c_2_f</td><td>fahrenheit</td></tr>";
$c_2_k = $degree+273.15;
print "<tr><td>$c_2_k </td><td>kelvin</td></tr>";
$c_2_r = $c_2_f+459.6;
print "<tr><td>$c_2_r</td><td>rankine</td></tr></table>";}
?>
This code converts a celcius temperature to fahrenheit, kelvin and rankine and then prints their values in a table below our original form. The form is still at the top of the page and is ready to accept new data. Currently if the data is anything but celcius it will be ignored. In our next step we will add in the other conversions so options other than celcius work.


