Delete file using a link

后端 未结 5 1343
执笔经年
执笔经年 2021-01-17 01:52

i want to have function like delete file from database by using link instead of button. how can i do that? do i need to use href/unlink or what? Can i do like popup confirma

5条回答
  •  半阙折子戏
    2021-01-17 02:37

    In PHP you use unlink() to delete a file. If you provide a page which accepts the file name (or better yet, file Id) as a parameter you can call unlink() on the file. Obviously there are some serious security implications which you will need to account for.

提交回复
热议问题