I am using the following code to show random pictures. is there an easy way to generate more code. Say if i wanted it to go to 1000 or more.
Code:
$random_number = rand(1, 5);
$random_picture[1] = '<a href="misc.php?do=page&template=ranpic"><img src="images/random/0001.jpg" alt="Click For Next" border="0" /></a>';
$random_picture[2] = '<a href="misc.php?do=page&template=ranpic"><img src="images/random/0002.jpg" alt="Click For Next" border="0" /></a>';
$random_picture[3] = '<a href="misc.php?do=page&template=ranpic"><img src="images/random/0003.jpg" alt="Click For Next" border="0" /></a>';
$random_picture[4] = '<a href="misc.php?do=page&template=ranpic"><img src="images/random/0004.jpg" alt="Click For Next" border="0" /></a>';
$random_picture[5] = '<a href="misc.php?do=page&template=ranpic"><img src="images/random/0005.jpg" alt="Click For Next" border="0" /></a>';
Basically i want to add everything between 1 and 1000 automatically:
Code:
$random_number = rand(1, 1000);
$random_picture[6] = '<a href="misc.php?do=page&template=ranpic"><img src="images/random/0006.jpg" alt="Click For Next" border="0" /></a>';
$random_picture[7] = '<a href="misc.php?do=page&template=ranpic"><img src="images/random/0007.jpg" alt="Click For Next" border="0" /></a>';
and everything between up to 1000, or more if needed. (can this be automated?)
$random_picture[1000] = '<a href="misc.php?do=page&template=ranpic"><img src="images/random/1000.jpg" alt="Click For Next" border="0" /></a>';