A couple thousand of the same image one one page.

SpaceshipSpaceship
Watch

Humdizzy

VIP Member
Impact
26
I'm looking for an easy way to put about 50,000 of the same image on one page. I know its easy just to copy and paste the image code, but it gets sort of hard to keep count when you have such a big number. I also plan to change the one image to another image. Anyone know an easy way to manage this. I'll just give an example of what I'm trying to do. Say 50000 stop lights all red. When the time comes I want to change some to green and leave the rest red.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Albino said:
use a loop in php to generate them, then if you want to change them, you can add certain clauses:

<?php

$image = "images/redlight.gif";
for($i=0;$i<=50000;$i++){

echo "<img src=\"".$image."\" alt=\"\" title=\"\" />";

}

?>

then you can add an if ($i == 4){echo diff image};

etc
And cache it, so you won't need to waste your system resources each time this runs.
http://www.ilovejackdaniels.com/php/caching-output-in-php/
 
0
•••
Nice site! :D
 
0
•••
Albino has it on the head. I would use PHP to generate loops of the desired amount.
 
0
•••
Appraise.net

We're social

Spaceship
Domain Recover
CatchDoms
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back