谁还有以前那个刷新一次改变一次图片的php代码
同上!拿来有用1 俺没有 我头像 忘记了~ http://blog.zzxt.com/?action=show&id=17 原帖由 ashun 于 2006-8-1 15:06 发表
<?php
$url='tx';
$files=array();
if ($handle=opendir("$url")) {
while(false !== ($file = readdir($handle))) {
if ($file != "." && $file != ".." ...
晕..
用代码的方式贴出来啊~~
我这个样子复制下去全部是... 原帖由 永远の魔道 于 2006-8-1 15:07 发表
晕..
用代码的方式贴出来啊~~
我这个样子复制下去全部是...
http://blog.zzxt.com/?action=show&id=17
我blog 3Q
<?php
$url='img'; //图片地址,只可以用./you/images这样的路径
$files=array();
if ($handle=opendir("$url")) {
;;; while(false !== ($file = readdir($handle))) {
;;;;;;;;; if ($file != "." && $file != "..") {
;;;;;;;;; if(substr($file,-3)=='gif' || substr($file,-3)=='jpg') $files = $file;
;;;;;;;;; }
;;; }
}
closedir($handle);
$random=rand(0,count($files)-1);
if(substr($files[$random],-3)=='gif') header("Content-type: image/gif");
elseif(substr($files[$random],-3)=='jpg') header("Content-type: image/jpeg");
readfile("$url/$files[$random]");
?>
我原来写了一个随机图片的JS代码!
页:
[1]
2