Se non vuoi complicarti la vita usa
Codice PHP:
echo "<meta http-equiv='refresh' content='5;URL=$file'>"
alla fine dell'operazione