Hi,
I have a form where people can upload images to the server and it's working fine, I made another form that lets them change the image, and that works fine also, the problem is, how do I delete the old image on the server?
I tried adding this code into a custom code event:
but it doesn't work, so I tried putting any type of code in an event, like a simple echo, but I get no response, I tried both controller and view, ad well as different places in the event order, but still no response, so how do I add a custom event? Am I missing something?
PS: the above code works elsewhere on the site, in an article, and the $fullimgpath also works because in the form I use it to display the old image to the user.
I have a form where people can upload images to the server and it's working fine, I made another form that lets them change the image, and that works fine also, the problem is, how do I delete the old image on the server?
I tried adding this code into a custom code event:
if($fullimgpath!=''){
unlink ($fullimgpath);
}
but it doesn't work, so I tried putting any type of code in an event, like a simple echo, but I get no response, I tried both controller and view, ad well as different places in the event order, but still no response, so how do I add a custom event? Am I missing something?
PS: the above code works elsewhere on the site, in an article, and the $fullimgpath also works because in the form I use it to display the old image to the user.