hello guys any body can help me how to add random links php codes to my site pages and tell me how to add random links appears two times in one page of mine site
Attachments:
random.zip
Started on the old forum in July 2009 · view the original in the archive · old links redirect here
hello guys any body can help me how to add random links php codes to my site pages and tell me how to add random links appears two times in one page of mine site
<?
//set the urls
$urls = array("http://google.com" ,"http://hotmail.com" ,"http://hawkee.com" );
//set the text links
$text = array("Google" ,"Hotmail" ,"Hawkee");
srand(time());
//set the number in (rand()%3); for however many links there are
$random = (rand()%3);
echo ("<a href = \"$urls[$random]\">$text[$random]</a>");
?>