罗列文件夹内的文件,并生成下载连接,就想公共ftp那样。
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″ />
<title>bkd’s download warehouse</title>
</head>
<style>
td{
with:50%;
color:black;
}
</style>
<body>
<script type=”text/javascript”>
</SCRIPT>
<h1>下载专用页面</h1>
<?php
$i = 1;
//echo $i;
$dirdemo = opendir(‘.’);
echo ‘<table border=”0″ with=”50%” >’;
while(($filedemo = readdir($dirdemo))!=false){
if ($filedemo!=”.” && $filedemo!=”..”&&$filedemo!=”index.php”) {
$nsdemo = explode(‘.’, $filedemo);
// echo $nsdemo[0].'<a hrer=\”http://www.myDownLoadSite.com/d’.$nsdemo[0].’\”>’.$nsdemo.'</a><br>’;
// echo ‘<tr>’;
// echo ‘<td>$i</td>’;
echo ‘<td>’;
echo $i.’.’.$nsdemo[0];
echo ‘</td>’;
echo ‘<td>’;
echo ‘<a href=”http://www.myDownLoadSite.com/d/’.$nsdemo[0].’.zip”>’.$nsdemo[0].'</a><br>’;
echo ‘</td>’;
echo ‘</tr>’;
$i++;
}
}
echo ‘</table>’;
closedir($dirdemo);
?>
</body>
</html>