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

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

Jul 13, 2016 am 10:59 AM
php+ajax win Original accomplish document time simulation Compare management system

I have been quite busy during this period, so I took some time off to finish it. Now I will continue to talk about the js.js file renaming function

function edit(e,path){


var text=e.innerHTML;


var eT=document.createElement("input");//The file name is rewritten according to the user's click


e.innerHTML="";


e.appendChild(eT);


eT.value=text;


eT.select();


e.onclick="";


eT.onblur=function(){                                      

CreateAjax();

if(text == this.value){

e.innerHTML=this.value;

e.onclick=function(){edit(this,path)};

Return false;

}else{

e.innerHTML=this.value;

Re_name(path,this.value,e);

e.onclick=function(){edit(this,path)};

}

};

}

The above is DOM+JS to complete and operate the file.

function CreateAjax(){//I won’t say much about this function, it has been discussed many times.

try { xmlhttp = new XMLHttpRequest();}

catch (e){

try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");}

catch (e2){

try { xmlhttp = new ActiveXObject("MSXML2.XMLHTTP"); }

catch(e3){ xmlhttp = false; }

}

}                                           

if( !xmlhttp){alert('Sorry, the browser you are using does not support AJAX!'); return false;}


}


function Re_name(o_name,n_name,e){ //Renamed here.

var name=o_name.replace(/.*/(.+)$/i,"$1");

if(name.match(/^w{1,255}.w{1,8}$/i)){//Use regular rules to determine the legality of the file name.

if(!n_name.match(/^w{1,250}.w{1,8}$/i)){

 

e.innerHTML=name;

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

Sorry, the file extension cannot be modified...
";

                                   

setInterval("func()",3000);
       
Return false;

}

}else if(name.match(/^w{1,255}$/i)){

if(!n_name.match(/^w{1,250}$/i)){

e.innerHTML=name;

       

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

";

setInterval("func()",3000);

Return false;


}

}else{

​​​alert('illegal operation');


e.innerHTML=name;

return false;

}

var url="rename.php?path="+encodeURI(o_name.replace("/","/"))+"&nname="+encodeURI(n_name)+"&rd="+Math.random();

Senddata('GET',url,ReturnValue,null); //Send to rename.php

}



http://www.bkjia.com/PHPjc/631848.html

truehttp: //www.bkjia.com/PHPjc/631848.htmlTechArticleI’ve been quite busy during this period, so I took some time to finish it. I’ll continue to talk about it today. js.js file renaming function function edit(e,path){ var text=e.innerHTML; var eT=docume...
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

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

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What to do if the 0x80004005 error code appears. The editor will teach you how to solve the 0x80004005 error code. What to do if the 0x80004005 error code appears. The editor will teach you how to solve the 0x80004005 error code. Mar 21, 2024 pm 09:17 PM

When deleting or decompressing a folder on your computer, sometimes a prompt dialog box "Error 0x80004005: Unspecified Error" will pop up. How should you solve this situation? There are actually many reasons why the error code 0x80004005 is prompted, but most of them are caused by viruses. We can re-register the dll to solve the problem. Below, the editor will explain to you the experience of handling the 0x80004005 error code. Some users are prompted with error code 0X80004005 when using their computers. The 0x80004005 error is mainly caused by the computer not correctly registering certain dynamic link library files, or by a firewall that does not allow HTTPS connections between the computer and the Internet. So how about

How to use shortcut keys to take screenshots in Win8? How to use shortcut keys to take screenshots in Win8? Mar 28, 2024 am 08:33 AM

How to use shortcut keys to take screenshots in Win8? In our daily use of computers, we often need to take screenshots of the content on the screen. For users of Windows 8 system, taking screenshots through shortcut keys is a convenient and efficient operation method. In this article, we will introduce several commonly used shortcut keys to take screenshots in Windows 8 system to help you take screenshots more quickly. The first method is to use the "Win key + PrintScreen key" key combination to perform full

How to implement dual WeChat login on Huawei mobile phones? How to implement dual WeChat login on Huawei mobile phones? Mar 24, 2024 am 11:27 AM

How to implement dual WeChat login on Huawei mobile phones? With the rise of social media, WeChat has become one of the indispensable communication tools in people's daily lives. However, many people may encounter a problem: logging into multiple WeChat accounts at the same time on the same mobile phone. For Huawei mobile phone users, it is not difficult to achieve dual WeChat login. This article will introduce how to achieve dual WeChat login on Huawei mobile phones. First of all, the EMUI system that comes with Huawei mobile phones provides a very convenient function - dual application opening. Through the application dual opening function, users can simultaneously

Win11 Tips Sharing: Skip Microsoft Account Login with One Trick Win11 Tips Sharing: Skip Microsoft Account Login with One Trick Mar 27, 2024 pm 02:57 PM

Win11 Tips Sharing: One trick to skip Microsoft account login Windows 11 is the latest operating system launched by Microsoft, with a new design style and many practical functions. However, for some users, having to log in to their Microsoft account every time they boot up the system can be a bit annoying. If you are one of them, you might as well try the following tips, which will allow you to skip logging in with a Microsoft account and enter the desktop interface directly. First, we need to create a local account in the system to log in instead of a Microsoft account. The advantage of doing this is

Comparing the performance of Win11 and Win10 systems, which one is better? Comparing the performance of Win11 and Win10 systems, which one is better? Mar 27, 2024 pm 05:09 PM

The Windows operating system has always been one of the most widely used operating systems on personal computers, and Windows 10 has long been Microsoft's flagship operating system until recently when Microsoft launched the new Windows 11 system. With the launch of Windows 11 system, people have become interested in the performance differences between Windows 10 and Windows 11 systems. Which one is better between the two? First, let’s take a look at W

Must read before purchasing a system: Analysis of the advantages and disadvantages of Win11 and Win10 Must read before purchasing a system: Analysis of the advantages and disadvantages of Win11 and Win10 Mar 28, 2024 pm 01:33 PM

In today's information age, personal computers play an important role as an indispensable tool in our daily lives. As one of the core software of computers, the operating system affects our usage experience and work efficiency. In the market, Microsoft's Windows operating system has always occupied a dominant position, and now people face the choice between the latest Windows 11 and the old Windows 10. For ordinary consumers, when choosing an operating system, they do not just look at the version number, but also understand its advantages and disadvantages.

Detailed steps to install Go language on Win7 computer Detailed steps to install Go language on Win7 computer Mar 27, 2024 pm 02:00 PM

Detailed steps to install Go language on Win7 computer Go (also known as Golang) is an open source programming language developed by Google. It is simple, efficient and has excellent concurrency performance. It is suitable for the development of cloud services, network applications and back-end systems. . Installing the Go language on a Win7 computer allows you to quickly get started with the language and start writing Go programs. The following will introduce in detail the steps to install the Go language on a Win7 computer, and attach specific code examples. Step 1: Download the Go language installation package and visit the Go official website

How to set the time for publishing works on Xiaohongshu? Is the time for publishing the work accurate? How to set the time for publishing works on Xiaohongshu? Is the time for publishing the work accurate? Mar 24, 2024 pm 01:31 PM

Xiaohongshu, a platform full of life and knowledge sharing, allows more and more creators to express their opinions freely. In order to get more attention and likes on Xiaohongshu, in addition to the quality of content, the time of publishing works is also crucial. So, how to set the time for Xiaohongshu to publish works? 1. How to set the time for publishing works on Xiaohongshu? 1. Understand the active time of users. First, it is necessary to clarify the active time of Xiaohongshu users. Generally speaking, 8 pm to 10 pm and weekend afternoons are the times when user activity is high. However, this time period will also vary depending on factors such as audience group and geography. Therefore, in order to better grasp the active period of users, it is recommended to conduct a more detailed analysis of the behavioral habits of different groups. By understanding users’ lives

See all articles