Home > Backend Development > PHP Tutorial > [Original] PHP+ajax implements simulated Win file management system 10_PHP tutorial

[Original] PHP+ajax implements simulated Win file management system 10_PHP tutorial

WBOY
Release: 2016-07-13 10:59:15
Original
937 people have browsed it

function Createfolder(){//Create folder


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


}

function Copy(path,tage){//Copy file


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);";//Set the transparency to make the user feel that the file has been cut,


Path=path+"|";


}


document.cookie = filepath+"="+path+"; expires="+time.toGMTString()+"; path="/";//Because global variables are used, the cookie saving function is used,


         


}



function Past(cookname,currentpath){//Get the file in the clipboard


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


var cookies = document.cookie;


if(cookies == ""){ alert("Cut and paste is empty!"); return false; }


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


for(var i=0;i<=arrar.length-1;i++){


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


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


Pastfile(returnvalue[1],currentpath);


}


}



}



function Pastfile(p_file,p_path){// Paste file


CreateAjax();


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


var url="rename.php?path="+encodeURI(p_path.replace("/","/"))+"&nname="+name+"©path="+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(){//Create folder document.getElementById('t').style.display=' block'; } function Copy(path,tage){//Copy file var time=new Date(); var filepath=filepath;...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template