Quote:
Originally Posted by Local Hero
That's the message I get because that's what I programed the code to say when it failed.
|
Ah ok, I had it in my head it was a PHP error message. Right in that case you're definitely using a url which is good to know.
Quote:
Originally Posted by Local Hero
Are you saying that I cannot delete a file, or delete it from the URL?
|
No of course you can't. That would be a MASSIVE security breach wouldn't it. Imagine if I could go to your website and just delete every page using a php script on my server and the url of your pages. That is the very point of http - it's pretty much a request and response protocol and thats it.
There are apparently some http servers that will allow a delete request but I've never used one, seen one or actually heard of anyone insane enough to run one. I would imagine there are uses for them but for general website hosting it's not used for the reasons above.
Quote:
Originally Posted by Local Hero
I can't figure out another way to delete the file from a button/link.
|
You need to use a local file system path instead.
Say your script is in your public_html folder and your image file is image.jpg and it's also in your public_html folder then you would:
unlink('image.jpg');
If it's in public_html/images/ then:
unlink('images/image.jpg');
and so on and so forth.
../ means up one level.
./ means this directory
Hope that helps

(PS off to bed now so if you've anymore questions someone else will need to answer).