How can I make a simple path generator?
Posted
by user360737
on Stack Overflow
See other posts from Stack Overflow
or by user360737
Published on 2010-06-07T19:01:00Z
Indexed on
2010/06/07
19:32 UTC
Read the original article
Hit count: 235
Hi all, I have a link that I have to repeat 50 times, for each folder, and I have 15 folders.the link that I have to repeat looks like this:
<a href="update/images/Cars/car (x).JPG" rel="lightbox[cars]"></a>
now, the jpg files are named car 1- car 50. and I would really like to be able to generate this script so that I can input the path "update/images/Cars/" the picture title (car) and the input the number of times that I need this link, and then have it spit out something that looks like this:
<a href="update/images/Cars/car (1).JPG" rel="lightbox[cars]"></a>
<a href="update/images/Cars/car (2).JPG" rel="lightbox[cars]"></a>
<a href="update/images/Cars/car (3).JPG" rel="lightbox[cars]"></a>
<a href="update/images/Cars/car (4).JPG" rel="lightbox[cars]"></a>
<a href="update/images/Cars/car (5).JPG" rel="lightbox[cars]"></a>
<a href="update/images/Cars/car (6).JPG" rel="lightbox[cars]"></a>
and then it keeps repeating, I'm assuming this can be done with a counter, but I'm not sure. Thanks!
© Stack Overflow or respective owner