Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > How to cycle through web pages, like Apple.com does?

How to cycle through web pages, like Apple.com does?
Thread Tools
Mac Elite
Join Date: May 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Jan 5, 2002, 04:18 AM
 
G'day all,

What I want to do I'm sure is quite simple. When people go to my website:

I want the main page to be randomly selected each time. Say I have like 4 pages, everytime a person goes to my site, it should randomly give them a different one.

I've seen Apple do this on their site a bit when they have different products that come up each time

Thanks for any help
(Last edited by thePurpleGiant; Jun 12, 2005 at 02:38 AM. )
     
Mac Elite
Join Date: Mar 2001
Status: Offline
Reply With Quote
Jan 5, 2002, 01:20 PM
 
Originally posted by thePurpleGiant:
<STRONG>G'day all,

What I want to do I'm sure is quite simple. When people go to my website:

www.jeremy.burge.com

I want the main page to be randomly selected each time. Say I have like 4 pages, everytime a person goes to my site, it should randomly give them a different one.

I've seen Apple do this on their site a bit when they have different products that come up each time

Thanks for any help

Jeremy</STRONG>
There's another thread about this but it goes this way:

You can do it a few different ways:
1. Client side
A javascript would decide which images and content to pull based on a random number

2. Server-side
An ASP or PHP or [insert server side scripting language of your choice] would:
1. generate a random number for that visitor to show them that page
2. go round robin and show each successive visitor the "next" page
3. show a visitor a particular page based on his browser type or any other HTTP header you can think of


I would try to guarantee (if that's what you want) that a given visitor (if he hit the home page n times where n=number of "random" pages) sees all n pages by [trying to] place a cookie to let your site know which page they awe (you can't guarantee that they were looking or turned their head or hit stop or closed their browser because you have to write the cookie as the 1st thing - or write the cookie on a subsequent page which they may never do).

I'm assuming you're a designer (vs. developer) so tell us exactly what you want and we cna get you started writing the code.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:45 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2