у меня страница
function sanitize ($input)
{
if (is_array ($input))
{
foreach ($input as $k => $i)
{
$output[$k] = sanitize ($i);
}
}
else
{
$output = mysql_real_escape_string ($input);
}
return $output;
}
function get_host ($hostid)
{
global $mcon;
$host = array ();
if(count($mcon[$hostid])>1)
{
$host['name'] = $mcon[$hostid][1];
$host['file'] = $mcon[$hostid][2];
$host_names['file'] = $mcon[$hostid][3];
}
return $host;
}
require 'includes/db.inc.php';
require 'includes/configs.inc.php';
require 'includes/mconfig.php';
$_GET = sanitize ($_GET);
$file_id = $_GET['uid'];
$data = mysql_query("SELECT name,size, hits, UNIX_TIMESTAMP(dtime) as dtime FROM file WHERE uid = '$file_id'") or die(mysql_error());
$file_info = mysql_fetch_array($data);
$file_name = $file_info['name'];
if (!($data = mysql_query ('' . 'SELECT hostid, url180, hits, status FROM mirrorfile WHERE uid = \'' . $file_id . '\'')))
{
exit (mysql_error ());
}
echo '
<div class="downloadarea downlinks" style=" margin-left:20px;">
<div class="heading1 links"> </div>
<table align="center" cellpadding="9" cellspacing="0" width="860">
<tr>
<th>Host</th>
<th>Download Link</th>
<th>Hits</th>
<th>Status</th>
</tr>';
while ($mirror_info = mysql_fetch_array ($data))
{
$host = get_host ($mirror_info['hostid']);
$hostfile = $host['file'];
$stat = $mirror_info['status'];
if ($mirror_info['status'] == 0)
{
$status = 'Upload';
}
else
{
if ($mirror_info['status'] == 1)
{
}
else
{
if ($mirror_info['status'] == 2)
{
$status = 'Failed';
}
else
{
if ($mirror_info['status'] == 3)
{
$status = 'Success';
}
}
}
}
$host_name= "".$host['name']."";
echo '<tr>
<td class="host"><img src=/imagesdo/' . $host['name'] . '.gif </img><br/><span style="display: none;position: absolute;">Click the button on the right side to <br/>download'.strtoupper(substr($file_name, 0, 40)).'<br/> from '.$host_name.'</span></td>';
if ($stat == 3)
{
if ($direct_url == '1')
{
echo '<td class="host"><a href=/redirect/' . $file_id . '/' . $mirror_info['hostid'] . ' target=_blank><img src=/images/click.png border=\'0\' /></a></td>';
}
else
{
echo '<td class="host"><a href=/redirect.php?uid=' . $file_id . '/' . $mirror_info['hostid'] . ' target=_blank><img src=/images/click.png border=\'0\' /></a></td>';
}
}
else
{
echo '<td class="host"><img src=/images/na.gif /></td>';
}
echo '<td class="host">' . $mirror_info['hits'] . '</td>
<td><img src=/images/' . $status . '.gif /></td>
</tr></div>';}