Problem with Loop?? Please URGENT
Hello,
I've got a URL created by a form that looks like this:
(with www not ***)
http://***.domain.com/page.php?tw_1=432047&tw_2=21&tw_3=66.....con't.... .
Then page.php is supposed to use the following code to ADD-up the values of the variables together.(The variables are actually "seconds"). Then this code is supposed to take the ADDED-up values and divide it up into minutes and seconds and display this in HH:MM format.
For some reason though it only comes out as 0's. I believe everything after "//end while" is fine because I currently use that exact code elsewhere and it works. I think the problem is with the loop that adds up the values of the variables. Do you see what's wrong with this? THANKS!
<?php
$iteratore = 1;
$total = 0;
while(isset($_GET['tw_'.$iterator])) {
$total += $_GET['tw_'.iterator];
$iterator++;
} //end while
$hours = floor($total/3600);
$remaining_seconds = $total - $hours*3600;
$minutes = floor($remaining_seconds/60);
if ($minutes < 10) { echo "<strong>$hours:0$minutes</strong>"; } else { echo "<strong>$hours:$minutes</strong>"; }
?>
Peter
|