url not allow in ulink function
can you use this
Itβs better, itβs also safe to use the absolute path. But you can get this path dynamically.
eg. via:
getcwd();
Depending on where your PHP script is located, your variable might look like this:
$deleteImage = getcwd() . 'img1.jpg'; unlink($deleteImage);
check this
bool unlink ( string $filename [, resource $context ] )
and
file name
The path to the file.
Thus, it only accepts a string as a file name.
Make sure the file is accessible from the path where the script is running. This is not a problem with absolute paths, but you may have one with relative paths.
source share