O'Reilly logo

Active Server Pages 3.0 from Scratch by Nicholas Chase

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Content Rotator

Another way to display the news is to display a random news item on the home page, along with a link to the news page itself. The Content Rotator component enables us to set up a list of news items and let the server choose which to display when a user calls the home page. Before we add the code to display the news, however, we need to create the file that lists the news itself.

Code Listing 3.26b. content.txt: Listing the potential news items for the home page
 001 1: %% #3 // Sky Surfers 002 2: The sequel to "Sky Surfers" will be coming out in theatres 003 3: next month. A new team member will be added with special 004 4: powers, and a romance may be starting between Ilsa and Gripper. 005 5: %% #2 // Incredible Rocket 006 6: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required