I have made a PHP array that parses a XML file and bulding a table from all the informations parsed from the XML file. EX:
Hostname Host S/N Process Comments Highlight CLICK TO SUBMIT BUTTON
Myhost01 3341221 Backup Finish in an hour [Checkbox]
Now, I want to make a checkbox button where the [Checkbox] is mentioned that when I check the Checkbox and click the submit button it will keep my checkbox checked with a V mark.
Now, my problem is that I print the "checkbox" inside the for loop so it will print it at the "Highlight" colums in each row, but I can't get it to keep after I'm clicking the button...
This is how it goes:
Code: Select all
$f = fopen ( $filename, 'r' );
for ($i = 0; $i < $filecount; $i++){
$hostname = $xml->box[$i]->hotname;
$operation = $xml->box[$i]->operation;
$version = $xml->box[$i]->version;
$cellnum = $xml->box[$i]->cell;
$ishold = substr($cellnum, 6);
$nXX = $ishold;
$textarea = $xml->box[$i]->notes;
date .=<div id=div1><th>$hostname</th><th>$operation</th><th>$version</th><th><input type=checkbox name=$nXX value=checkbox </th><th align=left><input type=checkbox align=left name=$cellnum value=1>$textarea</th></tr></div>";
// starting to print the table header
echo ('<TR bgcolor=teal align="center">
<th width="3%" bgcolor=teal><strong><font color=#FFFFFF>Hostname</font></strong></th>
<th width="3%" bgcolor=teal><strong><font color=#FFFFFF>Host S/N</font></strong></th>
<th width="4%" bgcolor=teal><font color=#FFFFFF><strong>Process</strong></th>
<th width="3%" padding="2" bgcolor=teal><font color=#FFFFFF><strong>Comment</strong></th>
<th width="3%" bgcolor=teal><strong><font color=#FFFFFF>Highlight</strong></th>
<th width="17%" align=center bgcolor=teal><font color=#FFFFFF><form name="Notes" action="hosts.php" method="post">Time: ');
echo date("Y-m-d H:i");
echo ('     <input type="submit" value="Click to Submit"></th>
</tr></strong>');
print $data;
echo "</table>"