• 0

PHP Random sig image


Question

there was someone on the forum who had a random image script where it would randomly pick one of his images for his sig and show it. i think it was a CGI script but i could be wrong. any help with creating one or finding one would be gladly apreciated

-Conundrum

Link to comment
Share on other sites

Recommended Posts

  • 0
Originally posted by PigeonHead

Yes, you can make a gif movie which changes the image every couple of seconds.

Please no, not gif animations. They are nasty. Use the php option.

Link to comment
Share on other sites

  • 0
Originally posted by ice-xp

Done. Thanks for your help!

Cool, you done that quick. Most people have a lot of trouble with it the first time round.

Link to comment
Share on other sites

  • 0

No offense, but was it really worth posting this? After all, this question has been answered 453435435 times and a simple search could have done the job.

Link to comment
Share on other sites

  • 0
Originally posted by sp00nman

No offense, but was it really worth posting this? After all, this question has been answered 453435435 times and a simple search could have done the job.

its ok..

he probably couldn't find it... :cool:

Link to comment
Share on other sites

  • 0
Originally posted by Blackwar

its ok..

he probably couldn't find it... :cool:

I hope so. Because a lot of people post away without thinking about searching first. Oh well, what's done is done.

Link to comment
Share on other sites

  • 0
Originally posted by sp00nman

I hope so. Because a lot of people post away without thinking about searching first. Oh well, what's done is done.

trust me, the moderators here do a good enough job of taking care of that..

You don't need to worry about it :)

just leave it to them ;)

Link to comment
Share on other sites

  • 0
Originally posted by Blackwar

trust me, the moderators here do a good enough job of taking care of that..

You don't need to worry about it :)

just leave it to them ;)

they sure do, the mods are great

Link to comment
Share on other sites

  • 0
Originally posted by SyS_Reactor

Dynamic sigs that show what ur comp is doing, like timdorr's old sig :)

also things like this forum software, vBulletin is all php :)

Link to comment
Share on other sites

  • 0



<?

$URL1="http://yoururlhere.com/image1.gif";

$URL2="http://yoururlhere.com/image2.gif";

$URL3="http://yoururlhere.com/image3.gif";



srand((double) microtime() * 1000);

$random = rand(1,3);



if($random == 1)

@header ("Location: $URL1");

elseif ($random == 2)

@header ("Location: $URL2");

elseif ($random == 3)

@header ("Location: $URL3");

?>

[/PHP]

Change from 1000000 to 1000. It seems more random. 1000000 really give results to image 1 like 80% of the time.

try it.

Link to comment
Share on other sites

  • 0

That code was written by me, but has been stripped of it's comments after time. Please comment code.

The original script was designed by a friend of Factions, in Perl. I ported it to PHP. The original development thread was started by me at zend.com and pre-dates any reference to the code, here is a link.

Here, I'll make it easy:





<?

//Random image generator

//Author: Weasel - www.almostsmart.com

$URL1="http://yoururlhere.com/image1.gif";

$URL2="http://yoururlhere.com/image2.gif";

$URL3="http://yoururlhere.com/image3.gif";



srand((double) microtime() * 1000);

$random = rand(1,3);



if($random == 1)

@header ("Location: $URL1");

elseif ($random == 2)

@header ("Location: $URL2");

elseif ($random == 3)

@header ("Location: $URL3");

?>



[/PHP]

Thank you.

Link to comment
Share on other sites

  • 0

Revival of the dead!

This is the simple version so far, I will add more options further on.

&lt;?php
$imgLink= Array ("Enter Image url here", "Enter Image url here", "Enter Image url here", "Enter Image url here");

$randNum= rand(0, count($imgLink)-1);

srand((double) microtime() * 10000);

$URL = $imgLink[$randNum];

@header ("Location: $URL");
?&gt;

To use it, just place the link where it says "Enter Image url here", make sure the link is within the quotes. If you want to add more links to, just after the last link, add a comma and then put the link in the quotes.

TO use this script, you have to copy the code above, and save the file as .php, and host it. TO use the script, just put the it between

[img=http://webhosturl.com/filename.php]

Example. refresh for randomness.

random.php

[img=http://hsb.gba-source.com/random.php]

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.