I want to display an echo when a file is deleted. For deleting files in a folder i use this loop:
if (isset($_GET['delete'])) {
// if is directory -> remove dir
if(is_dir($_GET['delete'])){
removeDirectory($_GET['delete']);
}
// else (must be a file) -> unlink file
else {
unlink($_GET['delete']);
}
echo 'file successful deleted!'; // this echo is lost...
// back to dir
$dir = dirname(($_GET['delete']));
header ("Location: ".'?dir='.$dir);
die();
}
Because of the header location, the echo will not be displayed. Thats a pitty. Is there a way i still can show an echo, even when there is a header location after it?