PHP uses stream to create thumbnails. Db_mysql.inc.php, config. php, and function. php are not actually used. The key is the $ filename file name. I read the image name in the database. Include_once (incdb_mysql where db_mysql.inc.php, config. php, function. php is not actually used. The key is the $ filename file name. I read the image name in 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],"MSIE")) { $attachment = ''; } else { $attachment = ' atachment;'; } $image = getInfo('newssp_gallery','id',$_GET['id']); $filename = $picPath.$image['filename']; if (!file_exists($filename)) { $filename = $picPath."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 498) this. width = 498 in the html file. 'onmousewheel = 'javascript: return big (this) 'src = 'showpic. php? Id = xxx 'width = '50' height = '50'>
Showpic. php and the above php file, id = xxx 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 on, for example, you need to implement a thumbnail with a width of 50, as long as 498) this. width = 498; 'onmousewheel = 'javascript: return big (this) 'src = 'showpic. php? Id = xxx 'width = '50'>.
(Edit responsibility:
Refer file name. I read the image name in the database. Include_once ('Inc/db_mysql...