Hi all, I am developing a script that reads i directory for images, and then displays all the jpg images in an html table dynamicly.
Below each image the image name is displayed as well as a check box, i want to be able to record the selections of images via the checkbox and write the image name to a file (or database, although i have not yet used databases so i am a bit wary of this), so that uf the page is loaded again the selected images are shown to be selected.
I would like each checkbox to be named with the image name in the loop.
Here is a link to the project: user:andy reed
[http://212.67.202.134/~weedinner/F57_DEVELOPMENT/PHP/Form.htm
here is my code so far:
<form>
<table width="435" height="325" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="147" bgcolor="#E2E2E2">nother image</td>
<td width="288">
<?
$jcthumbs = "../contacts/".$_SESSION['jcglobal']."/thumbnails";
$jcimages = "../contacts/".$_SESSION['jcglobal']."/images";
$dir = opendir($jcthumbs);
?>
<table border="1" cellpadding="3" cellspacing="10" bordercolor="#FF0000"><tr>
<?
$IC = 0;
while ($file = readdir($dir)){
if ( eregi(".jpg$","$file")){
$IC++;
if ($IC == 1){ print ("<tr>\n"); }
print ("<td><img src=$jcthumbs\\$file>\n");
print ("<a href=\"$jcimages\\$file\">$file</a>\n");
// if (blah = "ha") {
// $myImgSelect = "<input name="Selected" type="checkbox" value="" checked>";
// }
// else { $myImgSelect = "<input name="Selected" type="checkbox" value="" checked>";
print ("<input type=\"checkbox\" name=\"Selection\" value=\"picname\">\n");
print ("</td>");
if ($IC >= 4){ print ("</tr>\n"); $IC = 0; }
}
}
?>
</tr></table>
</td>
</tr>
</table>
</form>
thanks for any helps!