Example #1
0
    mkdir($userdir, 0766);
    // iterate through each file, make a hash for it and
    // stick it in the array of hashes
    foreach ($filelist as $fileshort) {
        $file = makeDIR($fileshort);
        $hashes[] = get_hash($file);
        copy($file, "{$userdir}{$fileshort}.csv");
    }
    $hash = merge_hashes($hashes);
    $hash = sort_hash($hash);
    // get CSV text and write it to the user file
    $csvstr = print_hash_to_csv($hash);
    $USERFH = fopen("{$userdir}selection_STATS.csv", "w");
    fwrite($USERFH, $csvstr);
    fclose($USERFH);
    // zip the directory and remove it
    $link = "built_manu_zips/{$userid}.zip";
    exec("zip -r {$link} {$userdir}");
    exec("rm -fr {$userdir}");
    // chmod the zip to be deletable by anything other than apache
    chmod($link, 0666);
    print_hash($hash, $link);
}
?>

<?php 
include $FOOTER;
?>


Example #2
0
    }
}
/**
	print out line of text with a label, to be used between PRE tags
	@param string $label a descriptive label or title
	@param string $line the text to display
	@return NULL
*/
function print_line($label, $line)
{
    echo $label . ": " . $line . "\n";
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>BaseElements Plug-In HTTP Test Helper</title>
</head>
<body>
<?php 
// make sure we ask for the username and password (if available)
header('WWW-Authenticate: Basic realm="BaseElements Plug-In"');
header('HTTP/1.0 401 Unauthorized');
$method = $_SERVER['REQUEST_METHOD'];
echo '<pre>';
print_line('Method', $method);
print_line('Path', $_SERVER['REQUEST_URI']);
print_line('Username', $_SERVER['PHP_AUTH_USER']);
print_line('Password', $_SERVER['PHP_AUTH_PW']);