• 0

Random Signature PHP


Question

<?
$URL1="Sigs/sig1.jpg";
$URL2="Sigs/sig2.jpg";
$URL3="Sigs/sig3.jpg";
$URL4="Sigs/sig4.jpg";
$URL5="Sigs/sig5.jpg";
$URL6="Sigs/sig6.jpg";


srand((double) microtime() * 1000000);
$random = rand(1,6);

if($random == 1)
    @header ("Location: $URL1");
elseif ($random == 2)
    @header ("Location: $URL2");
elseif ($random == 3)
    @header ("Location: $URL3");
elseif ($random == 4)
    @header ("Location: $URL4");
elseif ($random == 5)
    @header ("Location: $URL5");
elseif ($random == 6)
    @header ("Location: $URL6");  
?>

Thats my code, I have a sigs.php on the root of my ftp

and a folder called Sigs with sig1.jpg -> sig6.jpg

I do image tags and it still does not work

and I still get a redx

Whats up with that? :angry:

Link to comment
Share on other sites

10 answers to this question

Recommended Posts

  • 0

I think this belongs in the Web Programming forum. I'm not at all good with PHP, so I wouldn't be able to help you, but I know that timdorr can certainly solve your problem. :D

Link to comment
Share on other sites

  • 0

<?

srand((double)microtime()*1000000); 

Header("Location: ./image".rand(1,10).".gif"); 

?>

then name ur images

image1.gif

image2.gif

image3.gif ect (up to ten)

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.