SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2005
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHp delete the TXT file.

    I forgot how to wright this,
    Please help me

    Thanks

    Bin

  2. #2
    We're from teh basements.
    Join Date
    Apr 2007
    Posts
    1,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How to delete a file? Use the unlink() function.

  3. #3
    SitePoint Evangelist
    Join Date
    Sep 2004
    Location
    Oregon
    Posts
    445
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://us2.php.net/unlink

    PHP Code:
    unlink(path/to/page.txt); 

  4. #4
    Grumpy Minimalist
    Join Date
    Jul 2006
    Location
    Ontario, Canada
    Posts
    424
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by medicjoe95 View Post
    PHP Code:
    unlink(path/to/page.txt); 
    It might be helpful to add some quotes in there:
    Code PHP:
    unlink('path/to/page.txt');

  5. #5
    SitePoint Addict Php_penguin's Avatar
    Join Date
    Aug 2004
    Location
    Colwyn Bay, Wales, UK
    Posts
    287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    remember about the UNIX permissions.
    Code:
    $file = "path/to/page.txt";
    chmod($file, 0777);
    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
  •