The normal copy("thisflie.php","here.php")or die("error message");
Can I use if(copy()) { redirect page}
If there is an error in the copy()
how can I redirect the page.
The normal copy("thisflie.php","here.php")or die("error message");
Can I use if(copy()) { redirect page}
If there is an error in the copy()
how can I redirect the page.
If you check the documentation, you can see copy()
return TRUE
or FALSE
so you can simply do:
if(copy($source, $dest) === false){
// error here
}
Honestly, first port of call should be the docs. And as a side note, or die()
should never be "normal", you should handle your errors, not just kill the script mid-execution.