欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

[原创]php+ajax实现模拟Win文件管理系统十_PHP教程

程序员文章站 2022-06-12 14:53:39
...
function Createfolder(){//创建文件夹


document.getElementById('t').style.display='block';


}

function Copy(path,tage){//复制文件


var time = new Date();


var filepath ="filepath";


time.setTime(time.getTime()+60000);


if(tage == 'c'){


document.getElementById(path).style.filter = "Alpha(Opacity=50,style=0);";//设置透明度让用户感觉是文件被剪切了,


path=path+"|";


}


document.cookie = filepath+"="+path+"; expires="+time.toGMTString()+"; path=/";//由于要用到全局变量所以用了cookie保存功能,



}



function Past(cookname,currentpath){//取得剪板中的文件


if(cookname == "" ){return false;}


var cookies = document.cookie;


if(cookies == ""){ alert("剪切贴为空!"); return false; }


var arrar = cookies.split("; ");


for(var i=0;i


if( arrar[i].indexOf(cookname)!= -1 ){


returnvalue=arrar[i].split("=");


Pastfile(returnvalue[1],currentpath);


}


}



}



function Pastfile(p_file,p_path){// 粘贴文件


CreateAjax();


var name=p_file.substring(p_file.lastIndexOf("/")+1);


var url="rename.php?path="+encodeURI(p_path.replace("/","\/"))+"&nname="+name+"&copypath="+p_file+"&action=past&rd="+Math.random();


Senddata('GET',url,Pastreturn,'');



}



function Pastreturn(){


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


window.location.reload();


}


}


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/631918.htmlTechArticlefunction Createfolder(){//创建文件夹 document.getElementById('t').style.display='block'; } function Copy(path,tage){//复制文件 var time=new Date(); var filepath=filepath;...