| 网站首页 | 建站学院 | 资源下载 | 建站教程 | 图片素材 | 网贝社区 | 
您现在的位置: 网贝建站 >> 建站学院 >> PHP技术 >> php应用 >> 正文 用户登录 新用户注册
专 题 栏 目
最 新 热 门
最 新 推 荐
相 关 文 章
没有相关文章
图片直读代码,保存为index.php放在图片文件夹里         ★★★★
图片直读代码,保存为index.php放在图片文件夹里
作者:未知 文章来源:老枪论坛 点击数: 更新时间:2004-11-20 20:56:20
<?
$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);
/****************************************************/
?>
文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)