SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    will code HTML for food Michel V's Avatar
    Join Date
    Sep 2000
    Location
    Corsica
    Posts
    552
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    auto-deleting PHP script ?

    Quick question:
    Is it possible to make a PHP script that deletes itself after execution ?
    Do I have to chmod it writeable first ?
    [blogger: zengun] [blogware contributor: wordpress]

  2. #2
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can't you just use unlink("script.php"); in your script?

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  3. #3
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by seanf
    Can't you just use unlink("script.php"); in your script?

    Sean
    What Shin Ma meant was...so be able to delete itself after executing the entire script.Much like an uninstall script..

    after running through the uninstall procedures..it removes itself too for a clean uninstall..
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  4. #4
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    He would use unlink in his script to delete itself after it has executed successfully

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  5. #5
    will code HTML for food Michel V's Avatar
    Join Date
    Sep 2000
    Location
    Corsica
    Posts
    552
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll try unlink then. Thanks a lot

    Edit: oops, won't delete itself even after I chmoded it 777. I'll make a redirection to another script to delete it, then.
    Last edited by Michel V; Aug 12, 2001 at 09:23.
    [blogger: zengun] [blogware contributor: wordpress]


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
  •