<?php
require_once("../../../../include/global.php");
if (empty($dopost)) $dopost ="";
if (empty($urlvalue)) $urlvalue="";
if (empty($imgurl)) $imgurl ="";
if ($dopost=="upload"){
if (!is_uploaded_file($file)){
message("你没有选择上传文件","fck_image.php");
exit();
}
if (ereg("^text",$file_type)){
message("不允许上传此类型文件","fck_image.php");
exit();
}
if(!eregi("\.(jpg|gif|bmp|png)$",$file_name)){
message("上传的文件类型被禁止","fck_image.php");
exit();
}
$ext=array("image/pjpeg","image/jpeg","image/gif","image/png","image/x-png","image/bmp");
$file_type=strtolower(trim($file_type));
if (!in_array($file_type,$ext)){
message("上传的图片格式错误,请使用JPEG、GIF、PNG、BMP格式的其中一种!","-1");
exit();
}
$sname='.jpg';
if ($file_type=='image/pjpeg' || $file_type=='image/jpeg'){
$sname='.jpg';
}
else if($file_type=='image/gif'){
$sname='.gif';
}
else if ($file_type=='image/png' || $file_type=='image/x-png'){
$sname='.png';
}
else if ($file_type=='image/bmp'){
$sname='.bmp';
}
//保存目录
$upload='uploadfiles/';
$savepath=CMS_ROOT.$upload;
$filename=date('Ymdhis').mt_rand(1,9999);
$filename=$filename.$sname;
$fileurl=$savepath.$filename;
//再次检验后缀
if(eregi("\.(php|asp|pl|shtml|jsp|cgi|aspx|cer|asa|php2|php3|php4)",$filename)){
message("上传的文件类型被禁止","fck_image.php");
exit();
}
//上传
@move_uploaded_file($file,$fileurl);
//图片相对地址
$imgurl=CMS_PATH.$upload.$filename;
list($width,$height) = @getimagesize($fileurl);
//检验文件内部
$_fp = @fopen($imgurl,'r');
$_fstr = @fread($_fp,filesize($imgurl));
@fclose($_fp);
if($_fstr!='' && ereg("<(\?|%)",$_fstr)){
@unlink ($imgurl);
message("你上传的文件中含有危险内容,程序终止处理!","fck_image.php");
exit();
}
//$fileurl=addslashes($fileurl);
$sql="INSERT INTO {$db_prefix}files (oldname,filename,path,size,ext,time) VALUES ('$file_name','$filename','".addslashes($imgurl)."','$file_size','$file_type','$timestamp')";
$DB->query($sql);
}
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Image Properties</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="robots" content="noindex, nofollow">
<script src="common/fck_dialog_common.js" type="text/javascript"></script>
<script src="fck_image/fck_image.js" type="text/javascript"></script>
</head>
<body scroll="no" style="OVERFLOW: hidden">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr>
<td>
<form action="" method="post" enctype="multipart/form-data" name="form1" id="form1">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>新图片:</td>
<td><input type="file" name="file" />
<input type="submit" name="Submit" value="上传" />
<input name="dopost" type="hidden" id="dopost" value="upload" /></td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td><table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td width="100%"><span fckLang="DlgImgURL">URL</span></td>
</tr>
<tr>
<td><input id="txtUrl" style="WIDTH: 100%" type="text" value="<? echo $imgurl ?>"></td>
</tr>
</table></td>
</tr>
<tr>
<td><span fckLang="DlgImgAlt">Short Description</span><br />
<input id="txtAlt" style="width: 100%" type="text"></td>
</tr>
<tr>
<td valign="top"><table cellSpacing="0" cellPadding="0" border="0">
<TR>
<TD nowrap><span fckLang="DlgImgWidth">Width</span><br>
<input type="text" id="txtWidth" value="<?=$width?>" size="3"></TD>
<TD> </TD>
<TD><span fckLang="DlgImgHeight">Height</span><br>
<input type="text" id="txtHeight" value="<?=$height?>" size="3"></TD>
<TD> </TD>
<TD><span fckLang="DlgImgAlign">Align</span><br>
<select id="cmbAlign">
<option value="" selected></option>
<option fckLang="DlgImgAlignLeft" value="left">Left</option>
<option fckLang="DlgImgAlignAbsBottom" value="absBottom">Abs Bottom</option>
<option fckLang="DlgImgAlignAbsMiddle" value="absMiddle">Abs Middle</option>
<option fckLang="DlgImgAlignBaseline" value="baseline">Baseline</option>
<option fckLang="DlgImgAlignBottom" value="bottom">Bottom</option>
<option fckLang="DlgImgAlignMiddle" value="middle">Middle</option>
<option fckLang="DlgImgAlignRight" value="right">Right</option>
<option fckLang="DlgImgAlignTextTop" value="textTop">Text Top</option>
<option fckLang="DlgImgAlignTop" value="top">Top</option>
</select></TD>
</TR>
</table></td>
</tr>
</table>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
fckeditor精简版(php),带本地上传功能。
共54个文件
js:12个
gif:12个
html:9个
4星 · 超过85%的资源 需积分: 10 47 下载量 186 浏览量
2010-01-06
00:17:53
上传
评论
收藏 131KB RAR 举报
温馨提示
fckeditor精简版,带本地上传图片和附件功能,php版本,真的非常好用,加载速度很快。
资源推荐
资源详情
资源评论
收起资源包目录
editor.rar (54个子文件)
editor
index.php 862B
fckeditor_php4.php 3KB
fckeditor.php 151B
fckeditor_php5.php 3KB
fckeditor.js 6KB
fckconfig.js 4KB
editor
css
fck_editorarea.css 3KB
fck_showtableborders_gecko.css 685B
behaviors
showtableborders.htc 822B
disablehandles.htc 236B
fck_internal.css 410B
images
fck_flashlogo.gif 599B
Thumbs.db 4KB
skins
default
fck_strip.gif 5KB
toolbar
fck_strip.gif 5KB
_notes
fck_strip.gif.mno 145B
pagebreak.gif 151B
Thumbs.db 8KB
addon.gif 463B
fck_editor.css 4KB
fck_dialog.css 713B
Thumbs.db 6KB
images
toolbar.arrowright.gif 53B
toolbar.start.gif 105B
Thumbs.db 9KB
toolbar.end.gif 43B
toolbar.buttonarrow.gif 46B
toolbar.separator.gif 58B
fckeditor.html 5KB
images
spacer.gif 43B
Thumbs.db 6KB
plugins
insertcode
fck_insertcode.html 2KB
fckplugin.js 36KB
dialog
fck_about.html 2KB
fck_flash
fck_flash.js 3KB
fck_image
fck_image.js 2KB
fck_link.html 2KB
fck_table.html 7KB
fck_image.php 5KB
fck_about
logo_fckeditor.gif 2KB
fck_paste.html 9KB
fck_link
fck_link.js 4KB
common
fck_dialog_common.css 70B
fck_dialog_common.js 2KB
images
fcknumericfield.htc 439B
fck_flash.html 2KB
attach.php 4KB
fck_source.html 1KB
js
fckeditorcode_gecko.js 103KB
fckeditorcode_ie.js 109KB
lang
zh-cn.js 6KB
en.js 6KB
zh.js 6KB
fckdialog.html 5KB
共 54 条
- 1
资源评论
- van142013-08-17上传附件的时候提示出错,不知道是不是我自己不会弄,用不了。
- mengqingquan22013-01-12好用 就是不能上传图片
sanqou149
- 粉丝: 3
- 资源: 16
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功