惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Forbes - Security
Forbes - Security
GbyAI
GbyAI
WordPress大学
WordPress大学
小众软件
小众软件
Y
Y Combinator Blog
The GitHub Blog
The GitHub Blog
S
SegmentFault 最新的问题
A
About on SuperTechFans
月光博客
月光博客
F
Fortinet All Blogs
宝玉的分享
宝玉的分享
Microsoft Security Blog
Microsoft Security Blog
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
V2EX
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
N
Netflix TechBlog - Medium
Jina AI
Jina AI
博客园 - 聂微东
Schneier on Security
Schneier on Security
云风的 BLOG
云风的 BLOG
博客园 - 司徒正美
N
News | PayPal Newsroom
PCI Perspectives
PCI Perspectives
Last Week in AI
Last Week in AI
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
P
Proofpoint News Feed
Hacker News: Ask HN
Hacker News: Ask HN
B
Blog
aimingoo的专栏
aimingoo的专栏
P
Privacy International News Feed
Martin Fowler
Martin Fowler
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
NISL@THU
NISL@THU
Know Your Adversary
Know Your Adversary
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 叶小钗
N
News and Events Feed by Topic
T
The Exploit Database - CXSecurity.com
Stack Overflow Blog
Stack Overflow Blog
S
Security @ Cisco Blogs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
V
Vulnerabilities – Threatpost
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threatpost
IT之家
IT之家
B
Blog RSS Feed

博客园 - 狼问苍穹

怎样推广自己的博客 nfs文件系統 重新来过! 网站被挂iframe木马的解决方案 mysql截取函数LOCATE和POSITION PHP公历农历转换(阴历阳历转换)阴历和阳历转换 去掉fck里的图片 js 对FCKeditor 进行是否为空验证 Zend studio 打开 utf-8 出现乱码之解决办法 解决HTML内部元素的Mouse事件干扰(实例,兼容ff,ie) JavaScript事件监听完整实例 兼容IE、Firefox的DIV透明 阻止JavaScript事件冒泡传递 date picker plugin - jQuery 用法 Transact-SQL语句总汇(转载) 建一个临时表 php数组总结资料 js获取url参数 smarty date_format 产生乱码??
php图片、文件上传
狼问苍穹 · 2011-04-13 · via 博客园 - 狼问苍穹

 1 if ($_FILES['img']['tmp_name']) {
 2     if ($_FILES['img']['size'> 1000000) {
 3         $ctp->alert("错误:图片过大!");
 4         $ctp->goto("manage.php?type=active_add&id={$id}");
 5     }
 6     if (! in_array($_FILES['img']['type'], array('image/pjpeg', 'image/gif', 'image/x-png'))) {
 7         $ctp->alert("错误:请上传jpeg/jif/png格式的图片!");
 8         $ctp->goto("manage.php?type=active_add&id={$id}");
 9     }
10     $typeArr = array('image/pjpeg' => '.jpg', 'image/gif' => '.gif', 'image/x-png' => '.png');
11     $uploadDir = 'uploads/active/'.date('YmdHis').$typeArr[$_FILES['img']['type']];
12     move_uploaded_file($_FILES['img']['tmp_name'], $uploadDir);
13 }

 可以歇歇了!!

posted @ 2011-04-13 23:58  狼问苍穹  阅读(217)  评论()    收藏  举报