当前位置: 首页 > 图文教程 > 网络编程 > PHP > 回帖脱衣服的图片实现

PHP
在PHP中以root身份运行外部命令
PHP编程常用技巧四则
实例学习PHP之投票程序篇
PHP中的加密功能
PHP VS ASP
PHP生成动态WAP页面
PHP中for循环语句的几种变型
PHP5.0对象模型探索之对象串行化
PHP5.0对象模型探索之重载
浅议PHP程序开发中的模板选择
用PHP写的身份证验证程序
PHP.MVC的模板标签系统之初识PHP.MVC
PHP程序加速探索之代码优化
PHP程序加速探索之压缩输出gzip
用PHP文件上传的具体思路及实现
使用PHP编写基于Web的文件管理系统
理解PHP中的MVC编程之控制器
PHP程序加速探索之缓存输出
让你的PHP引擎全速运转的三个绝招
PHP程序加速探索之加速工具软件

PHP 中的 回帖脱衣服的图片实现


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-08-14   浏览: 49 ::
收藏到网摘: n/a

randimage.php

<?php
/*
+---------------------------------------------------------+
|ByBleakwindhttp://www.weaverdream.com
+---------------------------------------------------------+
*/
$dir="images/";//图片目录,注意是按照名字排序显示的...
$imgwidth=0;//图片宽度,为0则为原始大小
$iforder=1;//顺序显示还是随机显示,1为顺序显示,0为随机显示
$ifcircle=0;//顺序显示的时候是否循环播放,1为循环播放,0为不循环

session_start();
if($imgwidth==0){$imgwidth=="";}else{$imgwidth=="width='".$imgwidth."'";}
$handle=opendir($dir);
while($file_name=readdir($handle)){
if(($file_name!==".")&&($file_name!=="..")){$file_list[]=$file_name;}
}
closedir($handle);

if($iforder==1){
if(isset($_SESSION['sess_order'])){
if($_SESSION['sess_order']<count($file_list)-1){
$_SESSION['sess_order']++;
}else{
if($ifcircle==1){
$_SESSION['sess_order']=0;
}
}
}else{
$_SESSION['sess_order']=0;
}
$i=$_SESSION['sess_order'];
}else{
$num=count($file_list)-1;
$i=rand(0,$num);
}

readfile($dir.$file_list[$i]);
?>

调用
<imgsrc="randimage.php"border="0">