Simple Php Url Rotator

I need a Simple PHP Script To Rotate
URLs in a Round Robin Fashion (Not a
Random Fashion)

There will be a Flat Text Data file
like this:

1
http://Website1.com
http://Website2.com
http://Website3.com

(It will hold unlimited url’s)

The first line of the file will be a number
that indicates what URL is to be called next

The script will be called by clicking on a link

The Data file needs to be able to be edited
with a web based interface

It will start out like this

1
http://Website1.com
http://Website2.com
http://Website3.com

When you click on the link it will call the
script which will send you to Website 1 (in
a New Window)

Data file will now look like this

2
http://Website1.com
http://Website2.com
http://Website3.com

When you click on the link it will call the
script which will send you to Website 2 (in
a New Window)

Data file will now look like this

3
http://Website1.com
http://Website2.com
http://Website3.com

When you click on the link it will call the
script which will send you to Website 3 (in
a New Window)

Data file will now look like this

1
http://Website1.com
http://Website2.com
http://Website3.com

(and so on and so on)

It will also create a LOG File
so I keep track of the URL rotations

Format of Log:

Date, Time, URL

I did something like this myself
awhile ago in PERL but I want it
in PHP I took a RANDOM URL script
and modified to used a counter and
increment it rather than doing a
Random Routine

This shouldn’t take more than a few
hours. At least it didn’t when i did
it in PERL

Leave a Reply

Your email address will not be published. Required fields are marked *