搜索
查看: 2781|回复: 4

模块的PHP排行榜

[复制链接]
发表于 2008-10-3 14:08:09 | 显示全部楼层 |阅读模式 来自 中国–福建–莆田
[置顶] 【发布】全新使用模块的ASP排行榜[060811更新样式]
http://www.dt-club.net/forum/showthread.php?t=30547

看了两天的php教程,想找个东西练练刀
就拿上面那个排行榜下刀吧(不知道有没有发过)

和以前的一模一样
没有做任何修改,只是平台改掉了

今天找个个免费的mysql(以前还从来没用过,还挺难,菜鸟呀!)
随便找了点数据,给大家个演示地址
http://ptxy.700megs.com/index.php


大家可以到附件下载



<?php
$sertitle="点通CS混战服务器英雄";
$TOP=18;
$conn = @mysql_connect("127.0.0.1", "root", "fff") or die ("数据库连接错误");
mysql_select_db("amxmodx_stats_cs",$conn);
if($_GET["act"]=="seach"){
$strSQL = "SELECT * FROM cs where stats_name Like '%".$_POST["keyword"]."%' ORDER by stats_score DESC";
$query=mysql_query("$strSQL");
}else{
$strSQL = "SELECT * FROM cs ORDER by stats_score DESC";
$query=mysql_query("$strSQL");
}
mysql_query("set names 'GBK'");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="description" content="反恐精英排行榜">
<title>反恐精英排行榜</title>
</head>
<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0" bgcolor="#7A8C9A">
<div align="center">
<table border="0" width="780" id="table1" cellspacing="0" cellpadding="0" height="340">
<tr>
<td width="18">
<img border="0" src="TopRank/topl.gif" width="18" height="32"></td>
<td width="744" background="TopRank/topm.gif">
<p align="center"><b><font size="2" color="#333333">
<?=$sertitle?>TOP<?=$TOP?>排行榜</font></b></td>
<td width="18">
<img border="0" src="TopRank/topr.gif" width="18" height="32"></td>
</tr>
<tr>
<td width="18" background="TopRank/corkboard-left.gif" rowspan="3"> </td>
<td width="744" height="150" bgcolor="#F8F8F8" valign="top" background="TopRank/logo01.jpg">
<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="744" height="150">
<param name="movie" value="TopRank/topflash.swf">
<param name="quality" value="High">
<param name="wmode" value="transparent">
<embed src="TopRank/topflash.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="744" height="150" quality="High" wmode="transparent"></object>
</td>
<td width="18" background="TopRank/corkboard-right.gif" rowspan="3"> </td>
</tr>
<tr>
<td width="744" height="30" bgcolor="#F8F8F8">
<table border="0" width="744" id="table6" cellspacing="0" cellpadding="0" height="30">
<tr><form method="POST" action="index.php?act=seach">
<td width="80"><a href="index.php"><p align="center"><font color="#FF0000"><span style="font-size: 9pt; font-weight: 700">返回TOP<?=$TOP?></span></font></p></a></td>
<td width="620">
<input type="text" name="keyword" value="<?=$_POST["keyword"]?>" size="30" style="font-size: 9pt; font-family: 宋体; border: 1px solid #333333; "><span style="font-size: 9pt">
</span>
<input type="submit" value="查询玩家" name="B1" style="border:1px solid #CCCCCC; font-size: 9pt; font-family: 宋体; background-color:#FFFFFF">
<span style="font-size: 9pt">
</span><br>

</td>
<td width="80"></td>
</table>
</td>
</tr>
<tr>
<td width="744" bgcolor="#F8F8F8" valign="top" height="100">
<?php
$i=0;
while($row=mysql_fetch_array($query)){
$i++;
?>
<table border="1" width="744" id="table2" height="100" cellpadding="0" style="border-collapse: collapse" bordercolor="#CCCCCC">
<tr>
<td colspan="10" height="20" align="left" bgcolor="#88C4FF">
<p align="left"><font color="#FF0000"><span style="font-size: 9pt; font-weight: 700"><?php if($_GET["act"]!="seach"){echo "排名第";}?></span></font><font face="宋体"><span style="font-size: 9pt"> <font color=blue> <b>
<?php
if($_GET["act"]!="seach"){
echo $i;
}else{
echo "搜索结果";
}
?>
</b></font><font color="#FF0000"><b>&nbsp; <?=$row[stats_name]?></b></span></font>
</td>
</tr>
<tr>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">友军伤害</span></font></td>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">伤害</span></font></td>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">死亡</span></font></td>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">杀敌</span></font></td>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">射击</span></font></td>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">击中</span></font></td>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">爆头</span></font></td>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">效率</span></font></td>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">拆雷</span></font></td>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">拆雷成功</span></font></td>
</tr>
<tr>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_tks]?></span></td>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_damage]?></span></td>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_deaths]?></td>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_frags]?></span></td>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_shots]?></span></td>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_hits]?></span></td>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_hs]?></span></td>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt">%</span></td>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_defusions]?></span></td>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_defused]?></span></td>
</tr>
<tr>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">埋雷</span></font></td>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">炸弹爆炸</span></font></td>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">击中头部</span></font></td>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">击中胸部</span></font></td>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">击中腹部</span></font></td>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">击中右手</span></font></td>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">击中左手</span></font></td>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">击中右腿</span></font></td>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">击中左腿</span></font></td>
<td height="20" bgcolor="#F0F0F0" align="center">
<font color="#333333">
<span style="font-size: 9pt; ">分数</span></font></td>
</tr>
<tr>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_plants]?></span></td>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_explosions]?></span></td>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_bodyhits1]?></span></td>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_bodyhits2]?></span></td>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_bodyhits3]?></span></td>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_bodyhits4]?></span></td>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_bodyhits5]?></span></td>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_bodyhits6]?></span></td>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_bodyhits7]?></span></td>
<td height="20" align="center" onMouseMove ="this.style.backgroundcolor='#CAE4FF'" onMouseOut ="this.style.backgroundcolor='#F8F8F8'"><span style="font-size: 9pt;color=#0033CC"><?=$row[stats_score]?></span></td>
</tr>
</table>
<table border="0" width="100%" id="table99" cellspacing="0" cellpadding="0" height="5">
<tr>
<td></td>
</tr>
</table>
<?php
if($i==$TOP){
break;
}
}
if($i==0){
?>
<table border="1" width="744" id="table2" cellpadding="0" style="border-collapse: collapse" bordercolor="#CCCCCC">
<tr>
<td align="center" bgcolor="#88C4FF"><p align="center"><font color="#FF0000"><span style="font-size: 10pt; font-weight: 700">玩家不存在</span></font></p><a href="index.php"><p align="center"><font color="#FF0000"><span style="font-size: 9pt; font-weight: 700">返回TOP<?=$TOP?></span></font></p></a>
</td>
</tr>
</table>
<?
}
?>
</td>
</tr>
<tr>
<td width="18">
<img border="0" src="TopRank/corkboard-bottomleft.gif" width="18" height="28"></td>
<td width="744" background="TopRank/corkboard-bottom.gif">
<p align="right"></td>
<td width="18">
<img border="0" src="TopRank/corkboard-bottomright.gif" width="18" height="28"></td>
</tr>
</table>

<table border="0" width="100%" id="table100" cellspacing="0" cellpadding="0" height="24">
<tr>
<td align="center">
<p>
<span style="font-size: 12">--- 共计 [ <?php echo mysql_num_rows($query)?> ] 条数据 ---
</span>
<p><font color="#0033CC"><span style="font-size: 9pt">Power By 点通 [Grief.QQ] HomePage:http://xfwbvod.vicp.net/
QQ:157392753 Email:rain_hy@163.com 东瓜菜园修改</span></font></td>
</tr>
</table>
<?php mysql_close()?>
</div>
<body>
</body>
</html>

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
 楼主| 发表于 2008-10-3 14:11:37 | 显示全部楼层 来自 中国–福建–莆田

回复: 模块的PHP排行榜

不小心连密码都发了没关系啦~
忘记加标注了。

$conn = @mysql_connect("127.0.0.1", "root", "fff") or die ("数据库连接错误");
这个自己改下吧。
$sertitle="点通CS混战服务器英雄"; //服务器名
$TOP=18; //排行名次


mysql_select_db("amxmodx_stats_cs",$conn);------数据库名
$strSQL = "SELECT * FROM cs -------表名
注意有两个表名,要同时改

$strSQL = "SELECT * FROM cs where stats_name Like '%".$_POST["keyword"]."%' ORDER by stats_score DESC";
$query=mysql_query("$strSQL");
}else{
$strSQL = "SELECT * FROM cs ORDER by stats_score DESC";
$query=mysql_query("$strSQL");
}
回复

使用道具 举报

发表于 2008-10-3 19:10:40 | 显示全部楼层 来自 中国–安徽–安庆

回复: 模块的PHP排行榜

有没有演示啊?????
回复

使用道具 举报

发表于 2008-10-3 19:21:49 | 显示全部楼层 来自 中国–四川–南充

回复: 模块的PHP排行榜

我也要看演示
:super:
回复

使用道具 举报

 楼主| 发表于 2008-10-3 19:42:41 | 显示全部楼层 来自 中国–福建–莆田

回复: 模块的PHP排行榜

穷~本人什么都没有!
和原作一样
不过是吧asp换成了php罢了!
其实也没有什么。。
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表