Presumably you will use javascript to display images randomly. But what if the image information (such as a link) changes frequently, or is modified or added by the user? I have a solution here.
Put the image information (such as name, address, link, etc.) in a TXT file (MYSQL is better if it is available, but it doesn't matter if it is not available). The PHP program is called by javascript in the HTML file, and the PHP program randomly reads the image data. See the program <script src="/upimg/allimg/20060626/0910370.jpg
163 www.163.com image.163.com/images/logo.gif
sohu www.sohu.com $arrays=count($arrayall);
if ($arrays==1){//because rand(0,0) is wrong
$selectrand=0;
}else{
srand((double)microtime()*1000000);//Set random number seed
$selectrand=rand(0,$arrays-1);
}
$exstr=explode(chr(9),$arrayall[$selectrand]);//Randomly pick one out of all and split it
?>
document.write('<a href="<? echo $exstr[1];?>" target="new"><img src="<? echo $exstr[2];?>" width="200" height="50" alt="<? echo $exstr[0];?>" ></a>');
HTML file
<html>
<body>
<script language='javascript' src='readrand.php'>
</script>
</body>
</html>
(You can put scripty where you need it, and add the setTimeout() function to achieve regular refresh)