search
Homephp教程php手册[原创]php+ajax实现模拟Win文件管理系统九

[原创]php+ajax实现模拟Win文件管理系统九

Jun 13, 2016 am 09:58 AM
php+ajaxwinauthorOriginalaccomplishdocumentsimulationmanagement system

//

本站原创:www.drise.cn

作者:drise1

QQ:271728967

//

接上面的.
 function Senddata(method,url,ReturnValue,Action){  //保存数据

   xmlhttp.open(method,url,true); 

   xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  
   xmlhttp.setRequestHeader("Cache-Control","no-cache"); //不缓存

   if(ReturnValue !=null){

   xmlhttp.onreadystatechange=ReturnValue;

   }   

   xmlhttp.send(null);
   if(Action == 'mkdir')  //如果是创建文件夹就刷新窗口
   {
    window.location.reload();


   } 

 }


 function ReturnValue(){//返回值

  if(xmlhttp.readystate != 4 || xmlhttp.status != 200){
   document.getElementById("t0").innerHTML="

正在发送...
";
 }

  if( xmlhttp.readystate == 4 || xmlhttp.status == 200 ){

   document.getElementById("t0").innerHTML="

"+xmlhttp.responseText+"
";
 } 

 setInterval("func()",3000);//设置3000秒延迟
 }

 function func(){
  ob=document.getElementById('info');

    ob.style.display = 'none';

 }

下面为删除

 function del(obj){  


  if(confirm("确实要删除\""+obj+"\"吗?","","")){   


   CreateAjax();   


   var Delurl="rename.php?path="+encodeURI(obj.replace("/","\/"))+"&action=del&rd="+Math.random();


    xmlhttp.open("GET",Delurl,true);   


    xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");   


    xmlhttp.setRequestHeader("Cache-Control","no-cache");


    xmlhttp.onreadystatechange=function(){


     if (xmlhttp.readystate == 4 || xmlhttp.status == 200){ 


      var value=xmlhttp.responseText;


     if( value =='t' ){


      document.getElementById(obj).style.display="none";


     }else if( value =='fo'){


      alert("操作失败,请查看权限或文件夹不为空!foss!");


     }else if( value =="ff"){


      alert("操作失败,请查看权限!");


     }else{


      alert("操作失败,请查看权限或文件夹不为空!!");


     } 


     


    }


    }


    xmlhttp.send(null);


   }


 } 


  

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.