<?
Warning: is_file(): open_basedir restriction in effect. File(..) is not within the allowed path(s): (/home/usr/data/site/site.ru:/home/usr/data/musimba/tmp:.) in /home/usr/data/site/site.ru/sys/inc/random_logos.php on line 8
?>
Сам код который показывает полностью код
<?
<?php
2 function rand_logos($patch = "pic/logos/"
3 {
4 if(!$dir = opendir($patch)) return "Это не директория";
5 while(($t = readdir($dir)) !== false)
6 {
7 $ext = substr(strrchr($t,'.'), 1);
8 if(is_file($t) && ($ext == "gif"
|| ($ext == "jpg"
|| ($ext == "png"
)
9 {
10 $filename[] = $patch."/".$t;
11 }
12 }
13
14 closedir($dir);
15 $index = rand(0, count($filename) - 1);
16 $foto = "<img src=".$filename[$index].">";
17 return $foto;
18 }
19 echo rand_logos();
20 ?>
?>