Reply to undress code for download (PHP implementation)

Source: Internet
Author: User
1. If you want to reply and undress, set it to $ iforder = 1; $ ifcircle = 0; then you can...
2. You can put a group of images to remove them gradually .....

3. Add the following code to create the file randimage. php:
<? Php
/*
---------------------------------------------------------
| 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'] <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]);
?>

4. Call method:

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.