PHP's Simple File management (basic function)
First do a simple view of the file function, files and folders are displayed, but double-click the folder can display the next level of subdirectories, double-click < return to the previous level > can return to the previous level of the directory
<!doctype html>The following returns the previous level of $ (". Prev"). DblClick (function () {var url = $ (this). attr ("LJ"); $.ajax ({url: "chuli.php", Data:{url:url},type : "POST", DataType: "TEXT", Success:function (r) {window.location.href = "test.php";}})
To delete plus Click event $ (". SC"). Click (function () {var LJ = $ (this). attr ("LJ"); $.ajax ({url: "shanchu.php", Data:{lj:lj},type: "POST ", Success:function (R) {dataType:" TEXT ", window.location.href =" test.php ";});})
New Button $ ("#newf"). Click (function () {var name = $ ("#name"). Val ();//The user entered the file name $.ajax ({url: "xinjian.php", Data:{name:name },type: "POST", Success:function (R) {dataType: "TEXT", window.location.href = "test.php";});}) </script>
processing page :chuli.php
<?phpsession_start ();//The Writing of the page (cannot use post or get to pass value, can be used to pass the value of the session value is better). Session_Start (); To write at the top of PHP = $_post["url"];$_session["url"] = $url;? >
Delete Processing page :shanchu.php
<?PHP$LJ = $_post["LJ"];unlink ($LJ);? >
New Processing page :xinjian.php
<?php
Session_Start ();
$name = $_post["name"];//fetch to the parent directory. Create a file based on the parent directory. Get the name passed over
$url = $_session["url"];//takes the URL from $_session["url"]. Location of saved paths
$filename = $url. " /". $name;//He is the name file name. Piece together a full path
Touch ($filename);//New File Method Touch ()
?>
Simple File Management for PHP (basic functionality)