for what your trying to do a better way would be using jquery to load data from the database and randomly change each time you can set the time for reload but the page would not reload it works like a slideshow.
create a new file call it load.php then put this code on it:
<?php
$prefixes = array('one','two','three','four','five','six','seven','eight','nine','ten');
// This selects a random element of each array on the fly
echo $prefixes[rand(0,count($prefixes)-1)];
?>
its an array of words this could be changed to be fed from a database instead.
Then in another file (the file you want to load into) put this in the header of the page:
<!-- load jquery file -->
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>
<script>
//run when loaded
$(document).ready(function()
{
var refreshId = setInterval(function()
{
$('#timeval h3').load('load.php?r='+ Math.random());//set div id and file to load
}, 1000);//set timer count
});
</script>
the file loads in the jquery library file and then it creates a timer to load the php file ever 1000 miliseconds change it to suit then in the html put the in a div with an id of timer:
<div align="center" id="timeval"><h3></h3></div>
here's an example of a basic html file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>your title</title>
<!-- load jquery file -->
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>
<script>
//run when loaded
$(document).ready(function()
{
var refreshId = setInterval(function()
{
$('#timeval h3').load('load.php?r='+ Math.random());//set div id and file to load
}, 1000);//set timer count
});
</script>
</head>
<body>
<div align="center" id="timeval"><h3></h3></div>
</body>
</html>
that should sort it.