1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > php上传文件创建缩略图(code)

php上传文件创建缩略图(code)

时间:2019-11-03 13:46:49

相关推荐

php上传文件创建缩略图(code)

php教程|php手册

php,上传文件,创建缩略图

php教程-php手册

102400){ $error=1; $msg = "The photo is over 100kb. Please try again.";}////////////////////////////////// CHECK TYPE (IE AND OTHERS) //if ($userfile_type="image/pjpeg"){ if ($userfile_type!="image/jpeg"){ $error=1; $msg = "The photo must be JPG"; }}////////////////////////////////CHECK WIDTH/HEIGHT //if ($large_width!=600 or$large_height!=400){$error=1;$msg = "The photo must be 600x400 pixels";}/////////////////////////////////////////////CREATE THUMB / UPLOAD THUMB AND PHOTO ///if ($error1){ $image = $userfile_name; //if you want to insert it to the database $pic = imagecreatefromjpeg($userfile); $small = imagecreatetruecolor($small_width,$small_height); imagecopyresampled($small,$pic,0,0,0,0, $small_width, $small_height, $large_width, $large_height); if (imagejpeg($small,"path/to/folder/to/upload/thumb".$userfile_name, 100)){$large = imagecreatetruecolor($large_width,$large_height); imagecopyresampled($large,$pic,0,0,0,0, $large_width, $large_height, $large_width, $large_height); if (imagejpeg($large,"path/to/folder/to/upload/photo".$userfile_name, 100)) {}else {$msg="A problem has occured. Please try again."; $error=1;} } else { $msg="A problem has occured. Please try again."; $error=1; }}///////////////////////////////////////////////// If everything went right a photo (600x400) and/// a thumb(120x90) were uploaded to the given folders}?>create thumbSelect Photo: </body

【相关教学推荐】

仿720云源码,vscode中终端不显示,ubuntu命令 屏幕,tomcat6简介,爬虫下载地图,翻手算法 php,推广seo需要什么手续,网站php源码破解 版,手机站织梦模板下载地址lzw

1. php编程从入门到精通全套视频教学

2. php从入门到精通

3. bootstrap教学

查询网站源码工具,ubuntu如何编辑vi,爬虫爬取规则,php ord(),vue收录seolzw

万能api源码,ubuntu打开多个终端,tomcat报数据库错误,反爬虫手段视频,php订单需要注意什么,樊天华seolzw

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。