How does one go about creating a "delete this page" link which will delete the page a viewer has just been looking at? The viewed page would be a simple php message page, dynamically created and intended to be deleteable by the user.
I'm guessing that you would link to a "delete.php" page which knows the http referrer and uses it in a variable which is then handled by the unlink function, I just don't know how to write it, being a fresher to this and all!"
Help always appreciated... thanks in advance!
Deleting a page
Moderator: General Moderators
- mattcooper
- Forum Contributor
- Posts: 210
- Joined: Thu Mar 17, 2005 5:51 am
- Location: London, UK
- mattcooper
- Forum Contributor
- Posts: 210
- Joined: Thu Mar 17, 2005 5:51 am
- Location: London, UK
Thanks for pouncing on this so quickly, guys.
As I said, I'm a complete newcomer to php, and SQL is not something I'm up to speed with yet so I'm currently using flat text files to store info.
The page to be deleted will be a message document which, once read by the user, will either be printed or deleted - or both. That's why I will be creating a page for it to be deleted! So the user clicks a link that takes them to delete.php... I just don't know what to put in this page!
Some code examples would be oh-so-helpful, along with a bit of an explanation... that way I can learn and develop.
Thanks again..[/quote]
As I said, I'm a complete newcomer to php, and SQL is not something I'm up to speed with yet so I'm currently using flat text files to store info.
The page to be deleted will be a message document which, once read by the user, will either be printed or deleted - or both. That's why I will be creating a page for it to be deleted! So the user clicks a link that takes them to delete.php... I just don't know what to put in this page!
Some code examples would be oh-so-helpful, along with a bit of an explanation... that way I can learn and develop.
Thanks again..[/quote]