HalfLife,
Thanks for tryin', I'm not the best student. :rolleyes:
Drawmack,
Well I did as you instructed, but unfortunately it results in all 0's. This is what I have....
Ok, so now when I submit the form, the url looks like:
http://www.--------------/hours.php?tw_1=173&tw_2=18182&tw_3=66206
I also tried:
http://www.--------------/hours.php?tw_1=173_1&tw_2=18182_2&tw_3=66206_3
I am sending a couple extra variables, could this cause a problem?
http://www.--------------/hours.php?tw_1=173_1&tw_2=18182_2&tw_3=66206_3&un=peter&date_from=2003-11-23&date_to=2003-11-29&count_hours=Y&Submit2=Calculate+Hours
The PHP code I altered to match as follows:
<?
$iteratore = 1;
$total = 0;
while(isset($_GET['tw_'.$iterator])) {
$total += $_GET['tw_'.iterator];
$iterator++;
} //end while
//calculate hours worked
$hours = (int)($total/3600);
//calculate minutes worked
$minutes = (int)(($total - (3600 * $hours))/60);
//calculate the seconds worked
$seconds = $total - (3600 * $hours) - (60 * $minutes);
echo "You worked " . $total . " seconds (" . $hours . ":" . $minutes . "." . $seconds . ")<br />\n";
?>
The output is just "You worked 0 seconds (0:0.0)"
Not sure where the heck I went wrong. Do you see anything wrong with this?
Thanks again,