Results 1 to 7 of 7

Thread: Need Random page rotator

  1. #1
    Join Date
    Sep 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need Random page rotator

    hey,

    I'm looking for a solution to serve up random pages (100) and not sure what I need, any help would be appreciated.

    Thanks,
    Sheriece

  2. #2
    Join Date
    Jan 2008
    Posts
    4,167
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Do you want this server-side or client-side? Can you use PHP?

    Something like:
    Code:
    <?php
    $pages = array("http://google.com", "http://yahoo.com", "http://dynamicdrive.com");
    header("Location: ".$pages[rand(0, count($pages)-1)]);
    Could do the trick.
    Jeremy | jfein.net

  3. #3
    Join Date
    Sep 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hello Nile,

    Thank you for your response, the truth is I don't know what I don't know. This is how I imagine this to work. Once a person hits an initial html page and clicks a link, they are served up one of 100 pages. I also need the ability to make one of the pages (the winner) show every 1 in 1000 times. I assume these can be html pages. Once I have a script, where do I put it? I'd like to build this from a wordpress platform.

    Thanks in advance!
    Sheriece

  4. #4
    Join Date
    Aug 2011
    Posts
    18
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    That definitely sounds like server side. Pick the random page in your server side and insert into the href.

    If you are picking a "winner" you need to avoid javascript completely for this. Anyone can check the source and then make the winning page pop up very easily.

    Also, if this is some sort of "instant win" I would highly advise against doing this if you don't know what you're doing.

  5. #5
    Join Date
    Sep 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks, clearly I don't know what I'm doing. The winning page is served up on a mobile device to be taken into a business establishment to claim prize. It doesn't need to be on a wordpress platform. So I can take the code
    <?php
    $pages = array("http://google.com", "http://yahoo.com", "http://dynamicdrive.com");
    header("Location: ".$pages[rand(0, count($pages)-1)]);

    replace with my url's, copy into href on every url I create and the pages will dynamically rotate? Or do I put the code on the initial page only that they land on and click a link to see if they wonand are redirected to rotating page?

    How can I add the 1 in 1000 option to the code?

    Thanks for taking the time!
    Sheriece

  6. #6
    Join Date
    Aug 2011
    Posts
    18
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    The problem is, the first person to win can then spread the url of the winning page around and you'll have no way of knowing the real winner from the copies.

    Again, you do not want to get involved with any sort of instant win thing if you aren't an expert.

  7. #7
    Join Date
    Feb 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    hey Sheriece, did you ever get anywhere with this?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •