PHP Anti-dedecms attachment file Online management system (1/6) _php Tutorial

Source: Internet
Author: User
PHP Tutorial Anti-dedecms attachment file Online management system
How to use:
1. Establish the UploadFile directory in the root directory first
2. Value and figure: this is used to upload this picture to the parent window. The value, which is the file name, can be used for input, the picture, the image, for the editor. When you use this feature, the text box before value is populated with the ID value of the parent window. I can normally assign a value when I use a layer to eject this program.
3. Multiple files can be uploaded, if the target directory has the same file, then rename to "file name (n). jpg", and the same name 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");//type of upload allowed
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 '];
if ($dir = = ") {
Right (Uploadfolder);
} else{
$del _file = Empty ($_get[' del_file ')? ": $_get[' Del_file '];
if ($del _file = =") {
Open_folder ($dir);
}else{
Delete_file ($del _file);
}
}
}

1 2 3 4 5 6

http://www.bkjia.com/PHPjc/444917.html www.bkjia.com true http://www.bkjia.com/PHPjc/444917.html techarticle PHP Tutorial Anti-dedecms attachment file Online Management system use method: 1. Establish UploadFile directory 2 in the root directory first. Values and graphs: this is used to upload this picture to the parent window. The value of a pass ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.