View Single Post
  #4 (permalink)  
Old 03-26-2007, 10:53 AM
pagetta's Avatar
pagetta pagetta is offline
WebProWorld Veteran
 

Join Date: Nov 2004
Location: UK
Posts: 505
pagetta RepRank 2
Default

hi
we do this on our site each refresh randomly displays the contents of a file kept in a list - i'm not sure if its the slickest way of doing it but it works on our news item display (codestone)

it uses some simple php code
<?php
$sTextfile = "files.txt";
if ($aFiles = @file($sTextfile))
{
$sFileToInclude = rtrim($aFiles[array_rand($aFiles)]);
include "$sFileToInclude";
}
?>

'files.txt' is kept in the root folder and simply lists the absolute URL of each content html file.

HTH :-)
Reply With Quote