0

I am creating a list of images dynamically, following is the code

                        <?php 
                        for ( $counter = 0; $counter < $obj1->id; $counter ++)
                        { ?>
                            <tr><td> Week <?php echo($counter+1); ?></td><td><?php echo" <a href=\"#hiddenDiv\" rel=\"facebox\";>";?><img src="tue.png"/></a></td></tr>
                        <?php } ?>

when the user clicks on the image a form opens. every image represents a week so i need to uniquely identify on which week user is inserting data. i need id of that image through which i can identify a week

Thanks in advance

2
Contributors
1
Reply
3
Views
5 Years
Discussion Span
Last Post by stbuchok
0

You will probably want to move this to the PHP forum as this the JavaScript Forum.

However, it is probably something like this (I don't actually know PHP):

 <?php 
    for ( $counter = 0; $counter < $obj1->id; $counter ++)
    { ?>
    <tr><td> Week <?php echo($counter+1); ?></td><td><?php echo" <a href=\"#hiddenDiv\" rel=\"facebox\";>";?><img id="image_<?php echo($counter+1); ?>" src="tue.png"/></a></td></tr>
<?php } ?>

Or something like that.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.