I would do something like this:
PHP Code:
<td nowrap>
//http://www.javascriptkit.com/script/cut2.shtml to get clock using pure JS
<input type="text" class="button" size="1" name="clock">
<select name="time" size="1" >
<option selected="selected" value="none">Select a time</option>
<option value="<?=date('H:i')?>"><? echo (date('H:i')); ?></option>
<option value="08:00"></option>
<option value="09:00"></option
<option value="10:00"></option
</select>
</td>
//get the time from table
$query = "SELECT time FROM t_emp ;
$result = mysql_query($query) or die("Query failed: Fetch all rows");
<? while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { ?>
//printing
<td>
<? if ($_POST["time"] != "none") { #if $_POST["time"] does not equal "none" we know that they selected a time.
echo $line["time"];//workign fine when user selcts time field
}
else {?>
//this is problem area how i can print this live clock value if user dont select time as this clock is javascript(to get live clock)
//what should i write code for clock
<? }
}//end of while loop ?>
</td>
Bookmarks