一不小心弄到了kk66.com(雅客)的一部分代码,大家看看希望有帮助

_Shakespeare 2002-07-22 12:17:18
<?php
// ------------------------------ -------- ------------------------------ //
require ("./include/config.inc.php");
require ("./global.php");
include ("./include/header.php");
// ------------------------------ -------- ------------------------------ //
mysql_connect($dbhost,$dbuser,$dbpasswd) or die ("数据库连接失败");
echo "<title>".$site_name." - 下载系统 - powered by yemao.net</title>\n";
echo "<center>\n";
echo "<br><table border=0 cellpadding=3 cellspacing=0 style='border-collapse:c
ollapse' bordercolor=#efefef width=735>\n";
echo "<tr>\n";
echo "<td valign=bottom nowrap>";
// 本类/总数 ------------------------------
all_and_this();
// 搜索表单 ------------------------------
echo "</td>\n";
echo "<form method=POST action=list.php>\n";
echo "<td align=center valign=bottom nowrap>\n";
echo "<img src='./images/search.gif' width=16 heigth=16> ";
echo "名称<input type=checkbox name=name value='1'checked ";
echo ($name == 0 ? '' : checked);
echo ";>\n";
echo "简介<input type=checkbox name=brief value='1'checked ";
echo ($brief == 0 ? '' : checked);
echo ">\n";
echo "<input class=border type=text name=keyword size=12>\n";
echo "<select size=1 name=searchtype class=border>\n";
echo "<option value=0 selected>--==所有程序==--</option>\n";
// 查询大类
$typesql1 = "SELECT COUNT(*) AS rcnt FROM $down_sort1_table ORDER BY id";
$typeresult1 = mysql_db_query($dbname, $typesql1);
$typerow1 = mysql_fetch_array($typeresult1);
$typesql1 = "SELECT * FROM $down_sort1_table ORDER BY id";
$typeresult1 = mysql_db_query($dbname, $typesql1);
while ($typerow1 = mysql_fetch_array($typeresult1)){
$sort1id = $typerow1[id];
echo "<option>----".$typerow1[sort1]."----</option>\n";
// 查询小类
$typesql2 = "SELECT COUNT(*) AS rcnt FROM $down_sort2_table WHERE sort1id='$so
rt1id' ORDER BY id";
$typeresult2 = mysql_db_query($dbname, $typesql2);
$typerow2 = mysql_fetch_array($typeresult2);
$typesql2 = "SELECT * FROM $down_sort2_table WHERE sort1id='$sort1id' ORDER BY
id";
$typeresult2 = mysql_db_query($dbname, $typesql2);
while ($typerow2 = mysql_fetch_array($typeresult2)){
if ($type == $typerow2[id]):
echo "<option value='".$typerow2[id]."' selected>".$typerow2[sort2]."</option>
\n";
else:
echo "<option value='".$typerow2[id]."'>".$typerow2[sort2]."</option>\n";
endif;
} // while sort2
} // while sort1
echo "</select> \n";
echo "<input bgcolor=#efefef type=submit value=搜索 name=search class=border>\
n";
echo "</td></form>";
// 跳转分类 --------------------------
goto($type);
echo "</tr>\n";
echo "</table>\n";
echo "<br>\n";
// ------------------------------
echo "<table border=0 cellspacing=0 style='border-collapse:collapse' width=735
height=233 cellpadding=3>\n";
echo "<tr>\n";
echo "<td width=550 height=233 valign=top>\n";
// 转到搜索 ------------------------------
if ($search):
search($keyword,$searchtype,$name,$brief);
end;
else:
// 列出页数 ------------------------------
echo "<table border=1 cellpadding=3 cellspacing=0 style='border-collapse:colla
pse' bgcolor=white bordercolor=#C0C0C0 width=100%>\n";
echo "<tr>\n";
echo "<td width=100% align=right class=shadow2>\n";
list_pages($type,$setpage,$setid);
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<br>\n";
// 程序列表 ------------------------------
list_program($type,$setid);
// 列出页数 ------------------------------
echo "<table border=1 cellpadding=3 cellspacing=0 style='border-collapse:colla
pse' bordercolor=#C0C0C0 width=100%>\n";
echo "<tr>\n";
echo "<td width=100% align=right class=shadow2>\n";
list_pages($type,$setpage,$setid);
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<br>\n";
endif; // if search
// 排行显示 ------------------------------
echo "</td>\n";
echo "<td bgcolor=#f7f7f7 width=185 height=233 valign=top align=right>\n";
down_type_top10($type);
view_top10();
down_top10();
include ("./include/k666.php");
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<br><hr width=735>\n";
mysql_close();
// ------------------------------ -------- ------------------------------ //
include ("./include/footer.php");
// ------------------------------ -------- ------------------------------ //
?>
它的条理还是比较清楚的,而且里面包含了分页,查询的一些代码,希望会有帮助

更重要的,它的查询速度还是很快的。可以从这里面看看它的数据库的结构

浅妄薄见,望与斟酌
...全文
292 点赞 收藏 5
写回复
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
砖头恒久远 2003-05-06
夜猫的东西~
回复
lguser 2003-01-22
这种烂货不要去学了

写的最好的,我觉得是phpmyadmin,里面结构严谨,组织有序,定义分明
看懂这个程序,没什么摆不平的了。
回复
lapmx 2003-01-21
看国外的论坛程序比看这个长进快
回复
MeE 2003-01-21
抄别人的啊
回复
sakura169 2002-07-22
没觉得特别!
回复
发动态
发帖子
基础编程
创建于2007-09-28

2.1w+

社区成员

从PHP安装配置,PHP入门,PHP基础到PHP应用
申请成为版主
社区公告
暂无公告