I am having a little problem:
I am pretty "wet behind the ears" in the PHP world, so please, bare with me...I am tasked with writing a script that does two things:
(1) Allows a user to enter a temperature and based on a selection from a radio button, converts the temperature to either celcius or fahrenheit.
(2) Writes the output to another php page.
My problem lies when selecting either the celcius or fahrenheit radio button. How do I get either, based on selection, to write to the output? Do I need to write if/else statment or can I use case/switch?
Any and all advice is welcome. Remember, I am not at the advanced level yet, so please, bring yourself down a level or two (i.e. put yourself back at the beginning when you were first starting to develop... =) )
Here's my code for the output:
<?php
$mytempEntry=$_POST["tempEntry&qu ot;];
$convCelTemp=$_POST["convCel" ;];
$convFahTemp=$_POST["convFah" ;];
$convCelTemp=($mytempEntry - 32) *.55;
#echo $convCelTemp;
$convFahTemp=($mytempEntry * 1.8) + 32;
#echo $convFahTemp;
$celconvMsg=Celcius;
$fahconvMsg=Fahrenheit;
?>
<!doctype html public "-//w3c//dtd html 3.2 final//en">
<html>
<head>
<!-- Author: David Lindsey -->
<!-- ITEC2171 Mid-Term Page 2 -->
<!-- Last Revision: 3/7/05 -->
<title>Temperature Conversion 2</title>
<style>
body
{
font-family:tahoma,verdana,arial;
font-size:15pt;
}
h1
{
text-align:left;
}
</style>
</head>
<body>
<h1>Temperature Conversion</h1>
<p>The temperature you entered was <?php echo $_POST["tempEntry"]; ?>.</p>
<p>That is equivalent to <?php printf("%2.0f",$convCelTemp) ?> <?php echo $celconvMsg; ?>.</p>
<a href='convertTemp.php'?>Return to Temperature Page</a>
</body>
</html>
Thanks...