Forum Moderators: open

Message Too Old, No Replies

Rotating page script?

         

Scotl47

9:06 pm on Oct 24, 2007 (gmt 0)

10+ Year Member



I am trying to help some of the newer people in my company get some leads. Instead of getting a fancy lead distribution software, is there a way to rotate pages everytime a new visitor hits the site?

The actual page would be static, the application is in an iframe. I am looking for a way to get the iframe to reflect a different emplyees information everytime a new visitor hits the site.

Thanks for any help as I do not have time to manually distribute leads, and lead software is just not a fit.

Scot

penders

7:17 pm on Oct 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



...rotate pages everytime a new visitor hits the site?

Just to be clear, this is every 'visitor' rather than page refresh? IMHO, this sounds more suited to a server-side script such as PHP to ensure it is indeed every 'visitor' and that the same page isn't served to different 'visitors', or doesn't that matter?

Scotl47

10:40 pm on Oct 25, 2007 (gmt 0)

10+ Year Member



Yes, new page for every visitor, and not a page refresh. I was not sure where to start, I say Javascript for rotating banners so I started here.

Any ideas for a php script for this?

Thanks,

Scot

rocknbil

8:18 pm on Oct 26, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PHP, perl, you could *even* pull it off with Javascript though a server-side language would be better.

You start with a "list" of pages. This list could be dynamically read from a directory (Javascript can't do this, but you can have a list in the Javascript, you'd just have to update it every time a new file is added.)

Then you use some form of random selection to pick a random item from the list.

To insure the same visitor gets a different selection each time, when an item is selected you set a cookie noting the item id or name. Just before picking an item from the list, you read in the cookie and eliminate viewed items from the list. When the list in the cookie gets full, you flush it out and set a new cookie.