Among them, db_mysql.inc.php, config. php, and function. php are not actually applied. The key is the $ filename file name. Do I read the image name in the database? Phpinclude_once ('Inc/db_mysql.inc.php '); include_once ('Inc/config. php ');
Db_mysql.inc.php, config. php, and function. php are not actually applied. The key is the $ filename file name. I read the image name from the database.
Include_once ('Inc/db_mysql.inc.php ');
Include_once ('Inc/config. php ');
Include_once ('class/function. php ');
Global $ picPath;
If (strstr ($ _ SERVER [HTTP_USER_AGENT], 'msi ')){
$ Attachment = '';
} Else {
$ Attachment = 'atachment ;';
}
$ Image = getInfo ('newssp _ gallery ', 'id', $ _ GET ['id']);
$ Filename = $ picPath. $ image ['filename'];
If (! File_exists ($ filename )){
$ Filename = paipicpath.'notexist.gif ';
}
Header ('cache-Control: no-store, no-Cache, must-revalidate'); // HTTP/1.1
Header ('cache-Control: post-check = 0, pre-check = 0', false );
Header ('pragma: no-cache'); // HTTP/1.0
Header ('content-disposition: '. $ attachment. 'filename ='. $ image ['original']);
$ Size = @ filesize ($ filename );
Header ('content-Length: $ size ');
$ Fd = @ fopen ($ filename, rb );
$ Contents = @ fread ($ fd, $ size );
@ Fclose ($ fd );
Echo $ contents;
?>
You can add
Showpic. php and the above php file, id = *** is the record ID in the database, width is the width of the thumbnail, height is the height of the thumbnail, please do not both width and height are on, for example, you need to implement a thumbnail with a width of 50, as longIn this way, you can