Hi,
I hope I'm posting in the right place ... first time here.
I have this code from a classifieds program that creates checkboxes and there are 2 problems that are beyond me to fix.
1) This code inserts a blank box and I think it is to clear the mysql field of contents but I'm only guessing but the results look silly with a box doing nothing.
2) I want 2 have the results in columns and I've fiddled and fiddled but got nowhere.
Can anyone help me out? as the programmer of the script is a waste of time he just doesn't reply.
Code:
if ($type == 'c')
{
$i = 0;
$num_options = 0;
$c = 0;
$filled_in = 0;
//print_r($value);
if (file_exists("admin/options/$nb". ".txt"))
{
$options = file("admin/options/$nb". ".txt");
$num_options = count($options);
global $la_empty;
print "<input type='checkbox' value='empty' name='$fieldname" . "[]'> <br>";
for ($i=1; $i<$num_options; $i++)
{
print "<input type='checkbox' value='" . $i ."' name='$fieldname" . "[]'";
if (is_array($value))
{
foreach ($value as $element)
{
if ($element == $i)
print " checked='checked'";
}
}
print " />$options[$i]";
print " <br />";
}
}
else
print "You have not provided any options from admin area.";
}
|