Heh, lets look at the code...
<?
function dodays($monday_am,$monday_pm, $moday_eve, $tuesday_am, $tuesday_pm, $tuesday_eve,
$wednesday_am, $wednesday_pm, $wednesday_eve, $thursday_am, $thursday_pm, $thursday_eve,
$friday_am, $friday_pm, $friday_eve, $other)
{
?>
<table width="0" cellspacing="0" cellpadding="0">
<?
/* setting up variables */
$numcols = 3 ;
$numdays = 5 ;
$daylist = array( "monday", "tuesday", "wednesday", "thursday", "friday") ;
$boxlist = array( "am", "pm", "eve") ;
for ($day = 0 ; $day <= $numdays ; $day++ ) ;
{
print "<tr>" ;
$fullday = $daylist[$day] ;
//Cell 1
print "<td>$fullday</td>" ;
/* draw the boxes now */
/* Cell 2 should be in here?
for ($i = 0 ; $i <= $numcols ; $i++ );
{
$boxtime = $boxlist[$i] ;
$box = "$fullday_$boxtime" ;
*/
/* check to see if box needs ticking */
if ($$box == "1")
{
$button = "<input type=\"checkbox\" name=\"$box\" value=\"$boxtime\" checked>";
}
else
{
$button = "<input type=\"checkbox\" name=\"$box\" value=\"$boxtime\">";
}
//Cell 3
print "<td>$button</td>" ;
}
print "</tr>" ;
}
?>
</table>
<?
}
?>
As for variable variables, yes you can create them. You're trying to create a variable name variable which is not possible.... either that or you've got needless $day_$time variables being passed to the function as they aren't used in the code.
Mark