Erturk ve Angelo hocalarım sizleride uğraştırdım.yardımlarınız için çok teşekkür ederim.allah razı olsun.
bir kodda ben yazayım

umarım birilerinin işine yarar.
PHP:
<?php
$path = "/ornek/klasorresimlerinyeri/";
$dir = $_SERVER['DOCUMENT_ROOT'].$path;
$avatars = array();
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if (filetype($dir.$file) == "file" && getimagesize($dir.$file)) {
array_push($avatars, $file);
}
}
closedir($dh);
}
}
$img = $dir.$avatars[rand(0, count($avatars)-1)];
$info = getimagesize($img);
if ($info[2] == 2)
header('Content-Type: image/jpeg');
elseif ($info[2] == 3)
header('Content-Type: image/png');
else
header('Content-Type: image/gif');
readfile($img);
?>
Kod:
.htaccess
RewriteEngine On
RewriteRule ^phpkodu.*$ phpkodu.php
gerçek URL:
xxx.com/images/phpkodu.php
imaj rotator ile döndürülen URL:
xxx.com/images/phpkodu.gif
xxx.com/images/phpkodu.jpg
xxx.com/images/phpkodu.png