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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-13 10:59:131019browse

//

Original on this site: www.drise.cn

Author:drise1

QQ:271728967

//

Continue from above.
function Senddata(method,url,ReturnValue,Action){ //Save data

xmlhttp.open(method,url,true);

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

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

if(ReturnValue !=null){

xmlhttp.onreadystatechange=ReturnValue;

}

xmlhttp.send(null);
If(Action == 'mkdir') //If you create a folder, refresh the window
{
​ window.location.reload();


}  

}


function ReturnValue(){//return value

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);//Set 3000 seconds delay
}

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

ob.style.display = 'none';

}

Delete below

function del(obj){


if(confirm("Are you sure you want to delete""+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("The operation failed, please check the permissions or the folder is not empty! foss!");


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


alert("Operation failed, please check permissions!");


       }else{


alert("The operation failed, please check the permissions or the folder is not empty!!");


                                                                             


       


}


}


xmlhttp.send(null);


}


}


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631919.htmlTechArticle// Original on this site: www.drise.cn Author: drise1 QQ:271728967 // Continue from above. function Senddata(method,url,ReturnValue,Action){//Save data xmlhttp.open(method,url,true); xmlhttp.setR...
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