The image implementation code of the post and undress. The copy code of randimage. php is as follows :? Php * + --------------------------------------------------------- + | ByBleakwindwww.weaverdream.com + -------------------------- randimage. php
The code is as follows:
/*
+ ----------------------------------------------------------- +
| By Bleakwind http://www.weaverdream.com
+ ----------------------------------------------------------- +
*/
$ Dir = "images/"; // image directory, which is displayed by name...
$ Imgwidth = 0; // the image width. if it is 0, the original size is used.
$ Iforder = 1; // The sequence is displayed randomly. 1 is displayed sequentially, and 0 is displayed randomly.
$ Ifcircle = 0; // whether to play cyclically when the sequence is displayed. 1 indicates loop playback, and 0 indicates non-repeating.
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
The code is as follows:
The http://www.bkjia.com/PHPjc/825248.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/825248.htmlTechArticlerandimage.php code is as follows :? Php/* + --------------------------------------------------------- + | By Bleakwind http://www.weaverdream.com + ----------------------------...