
Chatbox|Admin nhận làm wap/web, giá cả thương lượng... Thông tin admin tại mỗi bài viết.
Hi, Khách!
![]() | ![]() ![]() ![]() ![]() |
Tạo 1 file bất kỳ .php ví dụ abc.php xong dán code này vào
<?php
@session_start();
@set_time_limit(0);
function getDir($dir='/',$root=null){
global $_SESSION;
if( is_dir($root.$dir)){
$dir_op = opendir($root.$dir);
$i =0;
while( $ar = readdir($dir_op)){
if( $ar!='.' && $ar!='..'){
if( is_dir($root.$dir.$ar)){
$_SESSION ['dir'[ = $root.$dir.$ar.'/';
getDir ($ar.'/',$root.$dir);
}else{
if( preg_match('#^index#i',$ar)) $i=1;
}
}
}
if(! $i){
file_put_contents ($root.$dir.'index.php',"<?php\n\theader('Location: '.\$_SERVER['HTTP_HOST');\n?>");
$_SESSION['cnt';
}
closedir ($dir_op);
return true;
}
return false;
}
$_SESSION['dir' = array();
$_SESSION['cnt' = 0;
getDir('wap/');
foreach($_SESSION['dir' as $f){
echo $f.'<br/>';
}
echo '<br/><hr/><b>'.count($_SESSION['dir').'</b> thu muc. Tao index cho <b>'.$_SESSION['cnt'.'</b> thu muc trong!<br/>';
unset($_SESSION['dir');
unset($_SESSION['cnt');
?>
Copy code
@session_start();
@set_time_limit(0);
function getDir($dir='/',$root=null){
global $_SESSION;
if( is_dir($root.$dir)){
$dir_op = opendir($root.$dir);
$i =0;
while( $ar = readdir($dir_op)){
if( $ar!='.' && $ar!='..'){
if( is_dir($root.$dir.$ar)){
$_SESSION ['dir'[ = $root.$dir.$ar.'/';
getDir ($ar.'/',$root.$dir);
}else{
if( preg_match('#^index#i',$ar)) $i=1;
}
}
}
if(! $i){
file_put_contents ($root.$dir.'index.php',"<?php\n\theader('Location: '.\$_SERVER['HTTP_HOST');\n?>");
$_SESSION['cnt';
}
closedir ($dir_op);
return true;
}
return false;
}
$_SESSION['dir' = array();
$_SESSION['cnt' = 0;
getDir('wap/');
foreach($_SESSION['dir' as $f){
echo $f.'<br/>';
}
echo '<br/><hr/><b>'.count($_SESSION['dir').'</b> thu muc. Tao index cho <b>'.$_SESSION['cnt'.'</b> thu muc trong!<br/>';
unset($_SESSION['dir');
unset($_SESSION['cnt');
?>
Copy code
Sửa lại như sau:
$dir = 'wap/';thành$dir = 'tên thư mục muốn kiểm tra';hoặc muốn tất cả thư mục ngang hàng thì để trống nó. Biến $root cũng vậy.
Xong rồi chạy file để bắt đầu.
*Nội dung file index mình đặt vào là chuyển hướng về domain chính, nếu không cần thiết các bạn không sửa cũng được.
Nguồn: daivietpda

Trực Tuyến:
Khách: 1