Hi
I am trying to remove an image file from a webserver and have got 777 permissions on the directory but cannot remove the file.
I know the action part is working and it is entering the IF statement! And I know that the $filename returned can be accessed when I paste it into a web browser.
Is my code incorrect?
And even when I place my UNLINK somewhere in the IF statement where is does get processed all I get back is:
I am trying to remove an image file from a webserver and have got 777 permissions on the directory but cannot remove the file.
I know the action part is working and it is entering the IF statement! And I know that the $filename returned can be accessed when I paste it into a web browser.
Is my code incorrect?
Code:
$filename = "[URL unfurl="true"]http://www.mywebsite/images/$_GET[/URL][fullpic]";
if ($action == 'delImage')
{
echo "$filename<br><bR>";
if(file_exists($filename))
{
echo "File does exist really";
unlink($filename);
}
else
{
echo "the file does not exist";
}
}
And even when I place my UNLINK somewhere in the IF statement where is does get processed all I get back is:
Code:
Warning: Unlink failed (No such file or directory)