Im using a batch that uses wget to download files from a directory that will run through a php page. the php will then forward the program to the correct directory for the download.
Here is a snippet of the PHP:
if (isset($_POST['update'])) {
    $host  = $_SERVER['HTTP_HOST'];
    $uri   = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
    $extra = $user;
    if (file_exists($extra)) {
        if ($_POST['update'] == 2) {
            header("Location: http://$host$uri/$extra/");
        } else if ($_POST['update'] == 3) {
            rename ($user,'z'.$user);
        } else { 
            echo "Update Available."; 
        }
    }
}
It is working well with a commercial server, but I cant make it work with the local IIS server that I setup. Most probably because of misconfiguration.
All other IF statements are working except for the HEADER LOCATION section.
 
    