I want to use PHO to generate dozens of almost identical HTML code section defining layers (div) to be hidden/showed on a page with PREV and NEXT action buttons handled by JavaScript functions. The things that change in each HTML code sections are 1) the div ID and 2) the .JPG file displayed by that div.
Here is the HTML code of the first div in a set:
[code]
![]() |
Here is some PHP code that works:
[php]<?php
for ($i=0; $i<length($set1); $i++)
echo "
?>[/php]
Since the layerSet1ImgX only changes as layerSter1Img1, layerSet1Img2 …
I would to generate these from the PHP index of the array containing the img src string, but I am having trouble in generating the correct string. Here what I did (that does not work):
[php]<?php
for ($i=0; $i<length($set1); $i++)
echo “<div id=‘layerSet1Img’”.$i+1."’ style=‘position:absolute;left:125px;top:350px;z-index:1;visibility:hidden’>
";
?>[/php]
What is wrong with this last PHP code ?
Thanks.