so i found this script which is perfect.. it loads all my content from my ftp and randomizes them.... BUT you always have to refresh the site.. my question now is.. how can i add a fixed frame or just a button which allows me to refresh the pictures instead of the whole page..
[already got an refrsh button.. but like i sad..for the whole page -.- not just the content.]
Thanks for any help and greets from germany.
<p align="center"><script type="text/javascript">
function random_imglink(){
<?php
function returnimages($dirname="./content/") {
$pattern="\.(jpg|jpeg|png|gif|bmp)$";
$files = array();
$curimage=0;
if($handle = opendir($dirname)) {
while(false !== ($file = readdir($handle))){
if(eregi($pattern, $file)){
echo 'myimages[' . $curimage .']="' . $dirname . $file . '";' . "
";
$curimage++;
}
}
closedir($handle);
}
return($files);
}
echo "var myimages=new Array();" . "
";
returnimages();
?>
var ry=Math.floor(Math.random()*myimages.length)
document.write('<img src="'+myimages[ry]+'" border=0>')
}
random_imglink()
</script>
<br>
<a href="javascript:document.location.reload();"
ONMOUSEOVER="window.status='Refresh'; return true"
ONMOUSEOUT="window.status='ah... that was good'">
<img src="images/refresh_button.jpg"
width="100" height="50" border="0" /></a>
</p>