![time.jpg time.jpg](https://lyvba.com/wp-content/uploads/2021/08/1336643898.jpg)
- 下载源码保存文件名
gettime.php
,如果修改文件名 form action=
要对应修改
gettime.php
源码
<html>
<head>
<meta charset="utf-8">
<title>下载时间计算器</title>
</head>
<body style="text-align:center;">
<a href="https://www.lyvba.com/index.php/archives/336/">
<img src="https://lyvba.com/wp-content/uploads/2021/08/1336643898.jpg" >
</a>
<p><p><p>
<form action="gettime.php" method="get">
下载速度(KB/s): <input type="text" name="speed">
文件大小(MB): <input type="text" name="size">
<input type="submit" value="开始计算">
</form>
<?php
$size = floatval($_GET["size"]);
$speed = floatval($_GET["speed"]);
$time = intval($size * 1024 / $speed);
if ($time > 0){
echo "下载速度: " . $speed . "(KB/s) 文件大小: " . $size . "(MB)<br>";
echo "下载所需时间: " . $time . "秒!<br>";
echo "换算时间: ". intval($time /3600) . "小时" . intval($time % 3600 / 60 + 0.5) . "分钟";
}
?>
</body>
</html>
![web.jpg web.jpg](https://lyvba.com/wp-content/uploads/2021/08/2147150959.jpg)
0 条评论