您的位置:首页 > 网络编程 > PHP

图片直读代码

日期:2005-10-14 00:00:00 点击: 来自: 作者:

保存为index.php放在你的图片目录里面中国站长资讯网

PHP源码:

<?
$imgtype
=array(bmp,jpg,jpeg,png,gif
);
/****************************************************/
$imgtype_count=count($imgtype
);
$path="."
;
$handle=opendir($path
);
while (
$file = readdir($handle
)){

if (
is_dir($file
)) {continue;}
$type = explode(".",$file
);
$type = $type[1
];

        for(
$i=0;$i<$imgtype_count;$i
++){
if(
$type==$imgtype[$i]){echo"<a href=".$path."/".$file." target=/"_blank/" alt=/"点击打开新窗口浏览/"><img src=".$path."/".$file." border=/"0/" onload=/"if(this.height>150) {this.height=150;this.width=150*this.width/this.height;}/"></a>/n"
;}
        }
                                }
closedir($handle
);
/****************************************************/
?>

More..素材图片 Picture Navigation
  •  彩云之南
  • 《超宽屏壁纸》带你体验大自然的魅力
  • 18张最美丽的北京风光 1600X1200 像素
  • 2ADVANCED 2006 壁纸系列
PHP热门 Class Hot
PHP推荐 Class Commend
版权所有:中国网站资源 2005- 未经授权禁止复制或建立镜像 This Site Tech:XHTML+DIV+CSS+Javascript
CopyRight ® 2005- www.Chinaddv.com online services. all rights reserved. ICP06016627
Optimized to 1024x768 to Firefox,Netscape,Opera,MS-IE6+.