All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
HTML语言剖析(八)表单标记_[Html教程]
自己在做项目过程中学到的PHP知识收集_php资料_编程技术
ASP.NET定制错误处理页面_[Asp.Net教程]
ASP.NET2.0的multiview和wizard控件_.net资料_编程技术
ASP.NET,2.0使用user,profile储存信息前,如何部署aspnetdb.mdf和连接_[Asp.Net教程]
HTML语言剖析(六)清单标记_[Html教程]
用javascript-css实现GridView行背景色交替、点击行变色_[Asp.Net教程]
ASP.NET1.1和2.0下进行https请求的不同实现_.net资料_编程技术
C#向ACCESS数据库插入图片_[Asp.Net教程]
如何在OS,X系统上配置Apache、PHP和MySQL_php资料_编程技术
Reading number is top 10 pictures
Plump, too plump!1
HongMenYan premiere XinLiangGong clairvoyant outfit PK YiFeiLiu1
心有鱼而力不足
奇趣的世界记录1
China telecom 114 spokesman MeiYanXu2
30 beautiful school beauty4
这还能睡得着?
姑娘手慢了,已经走光了
鸡蛋的新玩法
Wild animals melee moment of life and death2
Download software ranking
虚拟机5.5.3版
Boxer's Top ten classic battle5
打鸟视频
asp.netWeb服务器高级编程
都市狐狸姑娘传
美女写真3
WebService在.NET中的实战应用教学视频 → 第3集
Tram sex maniac 2 (H) rar bag15
虚拟机汉化软件
网页特效实例大全
归海一刀 published in(发表于) 2014/2/10 6:49:20 Edit(编辑)
php用流方式制作缩略图_[PHP教程]

php用流方式制作缩略图_[PHP教程]

php用流方式制作缩略图_[PHP教程]


其中db_mysql.inc.php,config.php,function.php不是真正使用到的,关键是filename 文件名,我是通过读取数据库中的图片名称

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;
?>

使用的时候可以把在html文件里加上



showpic.php及上面的那个php文件,id=xxx是数据库里的记录ID,width是缩略图的宽,height是缩略图的高,请不要同时宽高都上,例如,你要实现宽为50的缩略图,只要这样就可以了

来源:chinahtml





添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.