The following is an example for checkboxes,
If you have a variable named $checked & it is set by a value you pull out of a table (the values here are Yes or nothing.) Our example allows you to change value of Checked in the static page below;
<?PHP
$checked = "Yes"; //you can set this to "No" & when No the box won't be checked.
if ($checked == "Yes") {
$checked = "checked";
}
else {
$checked = "";
}
echo "
<head>
<title>Check</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">
</head>
<body bgcolor=\"#FFFFFF\" text=\"#000000\">
<form method=\"post\" action=\"do_update.php\">
<table width=\"228\" border=\"1\" cellspacing=\"2\" cellpadding=\"2\">
<tr>
<td width=\"74\">Value-->></td>
<td width=\"40\">
<div align=\"center\">
<input type=\"checkbox\" name=\"checked\" value = \"Yes\" $checked>
</div>
</td>
<td width=\"86\">$checked</td>
</tr>
<tr>
<td colspan = \"3\" align = \"middle\">
<input type=\"submit\" value=\"Submit\"></td>
</tr>
</table>
</form>
</body>
";
?>