显示页面
1 <script src="../../jquery-1.11.2.min.js"></script> 2 <style type="text/css"> 3 *{ margin:0px auto; padding:0px} 4 #wai{ 800px;} 5 .list{ 100%; height:35px; background-color:#09F; margin-top:2px; color:white; font-weight:bold; text-align:left; line-height:35px; vertical-align:middle; font-size:28px; padding:5px} 6 .mulu{ background-color:#FC9} 7 .mulu:hover{ cursor:pointer} 8 </style> 9 </head> 10 11 <body> 12 13 14 <br /> 15 <div id="wai"> 16 17 <?php 18 session_start(); 19 20 $filename=""; 21 22 if(!empty($_SESSION["lujing"])) 23 { 24 $filename = $_SESSION["lujing"]; 25 26 $sj = dirname($_SESSION["lujing"]);//找上级目录 27 echo "<div id='prev' class='list' lj='{$sj}'>返回上一层</div>"; 28 } 29 else 30 { 31 $filename = "./bootstrap"; 32 } 33 34 35 ?> 36 <div id="nr"> 37 38 <?php 39 40 //打开该文件夹 41 $dir = opendir($filename); 42 while($f = readdir($dir)) 43 { 44 if($f!="." && $f!="..") 45 { 46 $ml = $filename."/".$f; 47 if(is_file($filename."/".$f)) 48 { 49 echo "<div class='list'>{$f}</div>"; 50 } 51 else 52 { 53 echo "<div lj='{$ml}' class='list mulu'>{$f}</div>"; 54 } 55 } 56 } 57 58 closedir($dir); 59 60 ?> 61 </div> 62 </div> 63 64 <script type="text/javascript"> 65 66 $(".mulu").dblclick(function(){ 67 68 var lj = $(this).attr("lj"); 69 $.ajax({ 70 url:"chuli.php", 71 data:{lj:lj}, 72 type:"POST", 73 dataType:"TEXT", 74 success: function(){ 75 window.location.href="xiugai.php"; 76 } 77 }); 78 79 }) 80 81 $("#prev").dblclick(function(){ 82 var lj = $(this).attr("lj"); 83 $.ajax({ 84 url:"chuli.php", 85 data:{lj:lj}, 86 type:"POST", 87 dataType:"TEXT", 88 success: function(){ 89 window.location.href="xiugai.php"; 90 } 91 }); 92 93 }) 94 </script>
处理
<?php session_start(); $lj = $_POST["lj"]; $_SESSION["lujing"] = $lj;