09/10/2018, 22:42

hoi cach xoa tap tin va thuc muc

cac ban cho hoi lam sao xoa duoc file va thu muc bang php.?
neu cac ban co code thi gui cho minh .cam on nhieu
net_chat_com@yahoo.com
javandk viết 00:44 ngày 10/10/2018
Không thể được, bạn đang làm web chứ không phải phần mềm . . .
lh8x viết 00:58 ngày 10/10/2018
Không thể được, bạn đang làm web chứ không phải phần mềm . . .
Chài, k biết thì đừng nói bừa hen ^^
@achilles82: xài rmdir()

------------------------------
rmdir
(PHP 3, PHP 4 , PHP 5)

rmdir -- Removes directory
Description
bool rmdir ( string dirname [, resource context] )


Attempts to remove the directory named by dirname. The directory must be empty, and the relevant permissions must permit this. Returns TRUE on success or FALSE on failure.

Note: As of PHP 5.0.0 rmdir() can also be used with some URL wrappers. Refer to Appendix L for a listing of which wrappers support rmdir().

Note: Context support was added with PHP 5.0.0. For a description of contexts, refer to Reference CXX, Stream Functions.


Note: When safe mode is enabled, PHP checks whether the directory in which you are about to operate has the same UID (owner) as the script that is being executed.

Chú ý mấy chỗ style: bold.
real_time viết 00:56 ngày 10/10/2018
mình chỉ biết ASP thì dùng filesystemobject là làm được hết.

nhưng phải có quyền trên server
achilles82 viết 00:56 ngày 10/10/2018
cac cao thu php oi, to gap kho khan khi xoa mot website tren hosting, dung ftp xoa thi qua cham khi xoa ca website 20Mb. Vi minh can xoa de up website khac len.thao tac nay minh thuc hien rat nhieu lan.nen to muon tim cach lap trinh php de xoa cho nhanh hon. Theo cac ban xoa bang php nhanh hon khong?. vi To thay unzip tren server cuc nhanh luon. Ca website 20Mb unzip trong khoang 5s a

cac cao thu php oi, to gap kho khan khi xoa mot website tren hosting, dung ftp xoa thi qua cham khi xoa ca website 20Mb. Vi minh can xoa de up website khac len.thao tac nay minh thuc hien rat nhieu lan.nen to muon tim cach lap trinh php de xoa cho nhanh hon. Theo cac ban xoa bang php nhanh hon khong?. vi To thay unzip tren server cuc nhanh luon. Ca website 20Mb unzip trong khoang 5s a. Nho cac cao thu chi cho minh chi tiet hon mot chut nha. cam on nhieu
fantastic viết 00:50 ngày 10/10/2018
^^ tất nhiên là del = PHP sẽ nhanh hơn là FTP oài.
javandk viết 00:43 ngày 10/10/2018
Chài, k biết thì đừng nói bừa hen ^^
Trên Server thì nói làm gì chứ, còn trên nguyên tắc thì trên client theo mình là không được á . . .
ohyesssvn viết 00:49 ngày 10/10/2018
<?php

function deldir($dir) {
$dir.="/";

if ($handle = @opendir($dir)) {
while ($file = readdir($handle))
if (($file != ".") and ($file !=".."))
if (is_dir($dir.$file)) deldir($dir.$file);
else unlink($dir.$file);

closedir($handle);
rmdir($dir); }

}

deldir('E:/Temp');
?>
Bài liên quan
0