-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
53 lines (46 loc) · 1.33 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
*Doc by solo
*访问主页 index.php
*根据数据库中已有的信息:
*使用当前"总的访问时间"/"当前已经检测次数" = 平均访问速度
*使用当前"总的存活速度"/"当前已经检测次数" = 有效度
*得到平均访问速度升序、有效度(24小时内各时间点存活性计数)降序列表展示前50条代理记录;
*/
header('Content-type: text/html;charset = utf-8');
include("conn.php"); //引入数据库文件
$result = mysql_query("select
pro_host,
pro_port,
(total_time/pro_check_times) as ave_speed,
(pro_survival_times/pro_check_times) as ave_survival_time
from
uc_proxy
where
total_time > 0.0
and
pro_survival_times > 0.0
order by
ave_speed asc,
ave_survival_time desc
limit
50
");
echo "<table>";
echo "<tr>";
echo "<td>代理IP</td>";
echo "<td>端口</td>";
echo "<td>平均访问速度</td>";
echo "<td>有效度</td>";
echo "</tr>";
while($res = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>".$res['pro_host']."</td>";
echo "<td>".$res['pro_port']."</td>";
echo "<td>".$res['ave_speed']."</td>";
echo "<td>".$res['ave_survival_time']."</td>";
echo "</tr>";
}
echo "</table>";
?>