Can Any One Tell me How Should I add RAndom Links Script Two Times In One Pages

Started on the old forum in July 2009 · view the original in the archive · old links redirect here

1 reply · 384 views · started 17 years ago · 1 min read

2 participants
wapkerala Junior · 13 posts #1

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
opticalpigion Lead · 593 posts #2
<? 
 
//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>"); 
 
?> 

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close