OK
In addition to above, now, I need to incorporate my old lines of html/javascript into the php code:
The $display images line I need to print the equivalent to this html:
<a href="#_self" onClick="document.forms[0].on1.value='Image 0001';LoadGallery('weddinggallery', 'images/0001.jpg', 'imgNumberCaption', 'Image # 0001')"><img src="thumbs/0001.jpg" border="1"></a>
any file names need to be picked up from $images[$i]
the filenames are passed to various other locations on the page. the main location is a form. The other locations are just to show the visitor what number they are on and to change the main image dynamically.
my main php page at the moment reads as such:
<table width="1000" cellpadding="0" cellspacing="0" border="0">
<tr height="30">
<td rowspan="2" width="250" valign="top">
<div id="thumbsNav">
<?php
# Open dir and put file image names into an array, do count of total images.
$path = "images/"; //path from root
$dir = opendir ($path);
$count=0; #Initialize variable
while (false !== ($file = readdir($dir))) {
if (strpos($file, '.gif',1)||strpos($file, '.jpg',1)||strpos($file, '.JPG',1)||strpos($file,'png',1)) {
$images[] = $file;
$count++;
}
}
closedir($dir);
sort($images);
#Set number of images per page
$display_images ='';
for ($i = 0;$i <= 20;$i++){
$display_images .= '<div><a href="images/'.$images[$i].'"><img src="thumbs/'.$images[$i].'"></a></div>';
}
print $display_images; # Display the image code
?>
<br style="clear:both; height:0px;" />
</div>
</td>
<td id="imageNumber"width="500">
<div id="pagename"><SCRIPT>document.write(DocName)</SCRIPT></div>
<div id="imgNumberCaption">Image # 0001</div>
<hr style="clear:both" size="1" width="100%" align="right">
</td>
<td width="160" rowspan="2" valign="top" align="center">
<script language="Javascript" src="paypal.js" type="text/javascript"></script>
<script language="JavaScript" src="form.js" type="text/javascript">
</script>
<br />
</td>
</tr>
<tr height="490"><td width="500" align="center" valign="middle">
<!-- Main Changeable Image -->
<img src="images/0001.jpg" id="weddinggallery" border="6" style="border-color: black">
</td></tr>
<tr height="20">
<td colspan="3">
<img src="spacer.gif" width="20" height="1" border="0">page: <script language="Javascript" src="pages.js" type="text/javascript">
</script>
</table>
<p> </p>
</td></tr>
</table>
Any help with converting this code would be greatly appreciated