Myspoonistoobig
Such a Nice Young Lady
Offline
Post: 4400804_151 created on Tue Mar 22, 2005 12:38 pmPosted: Tue Mar 22, 2005 12:38 pm
![]() |
Peng R A M Z A Androphobia How about random text signatures (like off of cutandpastescripts)? I would like to do that, but it has yet to work. XP the only way to have random text woud be to make the text in an image... then add it to a random image script Or you could do some fancy PHP that would make a randomly-picked string of text into an image. Either way, this may have been mentioned already, but I had to change Ag2S03's code a bit to get it to work right: <?php $links = array( "images", "more images.jpg", "blahblah.gif", "myimage.png") $howMany = count($links) -1; // number of images to randomize srand ((double) microtime() * 948625) // seed the randomizer $randNumber = rand(0,$howMany) // make the random Number //select the image header("Location: ".$links[$randNumber]) ?> I had to make it subtract one from $howMany, and then make the minimum number rand could pick be zero instead of one. Otherwise the first image wouldn't ever show, and sometimes it would output absolutely nothing. all of those lines are unnecessary anyway.....PHP has array_rand() to pick a random element from an array. and as of php 4.2 (long time ago), you don't need to seed the random number generator so really, it can be shortened to this: <?php $links = array("images","more images.jpg","blahblah.gif","myimage.png") header('Location: ' . array_rand($links)) ?> |
|

















