Hello, this is my first post ever on a help board. I don’t see my first post although It says I’ve tried to post twice, sorry if I’ve screwed up already. I think I have done all the searching and editing and trial and error that I can do or understand. My problem is in the second block of php code.
What I need is for my code to take in a value for centigrade $centStart =$Start (the input as an int)and return a value for farhenheit $centEnd= $End(the input as an int). My formula is correct and works, but I am then supposed to increment the centigrade value into a table and display the temperatures in the table with alternating row colors. It seems like I should make the $i++ be $i=$i+10 but when I do I lose all of my rows except for the first one. So I’ve posted the code here as it increments by 1.
I hope I’ve done this right so you will see easily where I’m confused.
Any help is most appreciated .
[code]
PHP/Web220 Assignment5_2.phpAssignment 5_2
Centigrade to Fahrenheit Converter
//----declaring variables----
$Start_error = false;
$End_error = false;
$Start_error_msg = “”;
$End_error_msg = “”;
$rowcol= 0;
$rownum = 0;
$test4Infinity = ‘’;
//----decisions on data returned from form—
//----convert from Fahrenheit to Celsius using the formula
//----fahrenheit = centigrade * 9/5 + 32;
if ($Start == “”)
{
$Start_error_msg ="
You did not enter the Start temperature!";
$Start_error = true;
}
elseif (is_numeric($Start) == false)
{
$Start_error_msg = "
Enter numeric value for Start Temperature!";
$Start_error = true;
}
if ($End == “”)
{
$End_error_msg = "
You did not enter the End temperature!";
$End_error = true;
}
else
{
if ($End < $Start)
{
$End_error_msg ="
Start Temperature cannot be greater than the End temperature!";
$End_error = true;
}
}
if ($Start_error == true)
echo “
$Start_error_msg
”;if ($End_error == true)
echo “
$End_error_msg
”;if($Start_error == false && $End_error == false)
?> [/php]
[code]
Temperature in Centigrade | Temperature in Fahrenheit |
---|