come URL di redirect puoi usare quello che ti restituisce $_SERVER['HTTP_REFERER']