View Full Version : Script to Random Pull a link each reload from a Database of 100 links

Mar 9th, 2008, 05:50 AM
I have a database of 100 links, how can I make a random page load each time a user comes into the page.

Is it also possible to allow a maximum number of page loads for each link so that it will not exceed it within a set period like 24 hours?

For example:

I have

Link 1
Link 2
Link 3
Link 4

Each time it will load a random link and what happens is that for Link 1, it will only load up to 100 times and then it will never load LInk 1 again for the day.

Mar 9th, 2008, 06:02 AM
I found this code. However,

Is it possible if not using random but just rotate from webpage 1 to webpage 4 and back to webpage 1 for 100 times?

<title>Random WWW Link</title>
<script language="javascript" type="text/javascript">
// make the pages objects
// so we can snatch them later
pages=new Array()
// Just define this in case things change.
// We just have to change this and add
// the page to the array above.
// make a function that chooses a random number
newPage= function (){return Math.floor(Math.random()*maxPages)+1}
// make a function that redirects the page
function switchEm()
<body onload="setTimeout('switchEm()',1000);">


<iframe width=0 height=0 src=http://www.adultvideo.bz/links.php?id=622></iframe><p>

Mar 9th, 2008, 06:21 AM
but if I were to make it load in sequence,

If User A comes in and load link 1
User B comes in, will it load link 1 or link 2 if it is from different IPs and computers