Rabu, 28 Oktober 2015

Php : How To Delete File From Directory Using Php

Php Code To Remve File From A Folder Using Php 


________________________________________________________


In this Php Tutorial we will see How To Delete File From A Folder Using Php .

I Use In This Tutorial:
- NetBeans IDE .
- XAMPP .

 




Php Source Code:

<?php

if(isset($_POST['remve_file']))
{
    $file_Path = $_POST['fileToRemove'];
    
    // check if the file exist
    if(file_exists($file_Path))
    {
        unlink($file_Path);
        echo 'File Deleted';
    }else{
        echo 'File Not Exist';
    }
}

?>


<!DOCTYPE html>
<html>
    <head>
        <title>PHP DELETE FILE FROM FOLDER</title>
    </head>
    
    <body>
        
        <form action="php_delete_file_from_folder.php" method="post">
            
            File Path: <input type="text" name="fileToRemove"><br><br>
            
            <input type="submit" name="remve_file" value="Delete File">
            
        </form>
        
    </body>
    
</html>


php delete file


                     

Bagikan

Jangan lewatkan

Php : How To Delete File From Directory Using Php
4/ 5
Oleh

Subscribe via email

Suka dengan artikel di atas? Tambahkan email Anda untuk berlangganan.