Implementation code for pictures of taking off clothes in reply_PHP tutorial

WBOY
Release: 2016-07-13 10:24:58
Original
1420 people have browsed it

randimage.php

Copy code The code is as follows:

/*
+----- -------------------------------------------------- --+
| By Bleakwind http://www.weaverdream.com
+---------------------------- -----------------------------+
*/
$dir = "images/";//Picture directory , note that they are displayed in order by name...
$imgwidth = 0; //Picture width, if 0 is the original size,
$iforder = 1; //Sequential display or random display, 1 is sequential display ,0 means random display
$ifcircle = 0;//Whether to loop when displayed sequentially, 1 means loop, 0 means no loop

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']$_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]);
?>

Call

Copy code The code is as follows:


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/825248.htmlTechArticlerandimage.php Copy the code as follows: ?php /* +---------- --------------------------------------------------+ | By Bleakwind http://www.weaverdream.com +----------------------------...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!