cvs: phpweb /include get-download.inc
| From: | Gabor Hojtsy | Date: | Sat, 09 Aug 2003 16:43:45 +0000 |
| Subject: | cvs: phpweb /include get-download.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-20085@lists.php.net to get a copy of this message | ||
goba Sat Aug 9 12:43:45 2003 EDT
Added files:
/phpweb/include get-download.inc
Log:
Movet get_download out of the website root, as it is not supported
to access this directly. Download mirror selections are supported
via the /get/$filename/from/a/mirror URLs
Index: phpweb/include/get-download.inc
+++ phpweb/include/get-download.inc
<?php
// $Id: get-download.inc,v 1.1 2003/08/09 16:43:45 goba Exp $
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/mirrortable.inc';
// Try to make this page non-cached
header_nocache();
// If there is no such file, then drop out an invalid file error message
if (!isset($df) || !file_exists($_SERVER['DOCUMENT_ROOT'] . '/distributions/' .
$df)) {
exit('Invalid file requested for download!');
}
// Set local file name
$local_file = $_SERVER['DOCUMENT_ROOT'] . '/distributions/' . $df;
// Print out common header
commonHeader('Get Download');
?>
<h1>Choose mirror site for download</h1>
<p>
You have chosen to download the following file:
</p>
<div class="center">
<table border="0" cellpadding="10" cellspacing="1"
width="500">
<tr bgcolor="#cccccc"><td align="center">
<?php
echo '<strong>' . $df . '</strong><br />';
// Try to get filesize to display
$size = @filesize($local_file);
if ($size) {
echo '<small>' . number_format($size, 0, '.', ',') . '
bytes</small><br />';
}
?>
</td></tr></table>
</div>
<p>
Please choose the mirror closest to you from which to download the file.
The current mirror is highlighted in yellow, mirror sites detected to be
out of date or disfunctional are not listed for your convenience.
</p>
<?php
mirror_list($df);
commonFooter();