SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,223
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    deleting a file named "myFile.php" in the same directory.

    I like to make a file named "delete.php" which delete a file named "myFile.php" in the same directory with "delete.php".

    Can I make the file "delete.php" with your help?
    What code should I put for deleting the file "delete.php"?

  2. #2
    Community Advisor bronze trophy
    fretburner's Avatar
    Join Date
    Apr 2013
    Location
    Brazil
    Posts
    1,389
    Mentioned
    45 Post(s)
    Tagged
    12 Thread(s)
    Hi dotJoon,

    You can use the unlink function to delete files. You should also check that the file exists first:
    PHP Code:
    $file 'myFile.php';
    if (
    file_exists($file)) {
        
    unlink($file);



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •