Home >Backend Development >PHP Tutorial >PHP anti-dedecms attachment file online management system (1/6)_PHP tutorial
php tutorial anti-dedecms attachment file online management system
How to use:
1. First create the uploadfile directory
in the root directory 2. "Value" and "Picture": This is used to transfer this picture to the parent window. Value, passes the file name, which can be used for input; Picture, passes the image, and is used in the editor. When using this function, first fill in the text box in front of "Value" with the ID value of the parent window. When I use the layer to pop up this program, I can assign values normally.
3. Multiple files can be uploaded. If the target directory has the same file, rename it to "file name (n).jpg", the same naming method as FCKeditor
Test environment: apache2.2.14 + PHP5.3 + windowswww. bkjia.com
*/
header("Content-type: text/html; charset=UTF-8");
define("ROOT",str_ireplace('/waityou /'.basename(__FILE__),'',str_ireplace("","/",__FILE__)));
define("UploadFolder","/uploadfile/");//Upload root directory
define ("_d",$_SERVER['DOCUMENT_ROOT']);
define("AllowUploadType","gif|jpg|png|txt|doc|xls|ppt|pdf|rar|zip|7z|chm|mp3| mp4|mpg|mpeg|flv|swf");//Types allowed to be uploaded
define("MaxUploadSize",@ini_get('upload_max_filesize'));
$act = empty( $_GET['act'])?'':$_GET['act'];if($act == ""){
html_header();
}elseif($ act == 'left'){
left();
}elseif($act == 'right'){
if(!empty($_POST['upfolder'])) {
upload_file();exit;
}$dir = empty($_GET['folder'])?'':$_GET['folder'];
http://www.bkjia.com/PHPjc/444917.html
if($dir = = ''){
right(UploadFolder);
}else{
$del_file = empty($_GET['del_file'])?'':$_GET['del_file'];
if($del_file == '') {
open_folder($dir); 🎜>
1 2 3 4 5 6
www.bkjia.com