This should do it:
<?php
set_time_limit(0);
$industry = "industryid"; //replace this
$url = "https://ourwebsite/downloadzip.php?industryid=$industry";
$tmppath = "/tmp/tmpfile.zip";
$themdir = "/your/path/wp-content/themes/";
$fp = fopen ($tmppath, 'w+');//This is the file where we save the zip file
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_TIMEOUT, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_FILE, $fp); // write curl response to file
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_exec($ch); // get curl response
curl_close($ch);
fclose($fp);
if (file_exists($tmppath)){
$zip = new ZipArchive;
$res = $zip->open($tmppath);
if ($res === TRUE)
{
$zip->extractTo($themdir);
$zip->close();
echo 'Theme file has been extracted.';
}
else
{
echo 'There was a problem opening the theme zip file: '.$res;
}
}
else{
echo("There was an error downloading, writing or accessing the theme file.");
}
?>