永发信息网

PHP的一个框中插入页面

答案:1  悬赏:60  手机版
解决时间 2021-05-14 17:58
  • 提问者网友:捧腹剧
  • 2021-05-14 07:10

其实我也不大会解释啦,就是在一个页面的一个区中插入一段代码,而这段代码是独立的,此代码与数据库有密切关系,代码如下

<?php
//get the top 6
mysql_query("set names 'GBK'");
$query = mysql_query("SELECt * FROM `guilds` ORDER BY `GP` DESC ");

//rank= 0 for ranking numbers
$rank = "0";

//start ing the table before the loop
?>
<table width="535" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="images/welcome.gif" width="485" height="43" border="0" usemap="#Map" />
<map name="Map" id="Map">
<area shape="rect" coords="427,9,475,26" href="main.php?page=view&amp;id=1" />
</map></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="5" cellpadding="0">
<tr>
<td><?
mysql_query("set names 'gbk'");
$query = "Select COUNT(*) FROM news";
$result = mysql_query($query);
$num = mysql_num_rows($result);
$page_count = ceil($num/$page_size);
//$offset = ($page_count-1)*$page_size;
if(empty($_GET['page']))
{
$page = 1;
}else
{
$page = $_GET['page'];
if($page<=0)
{
$page = 1;
}else
{
$page >= $page_count;
$page = $page_count-1;
}
}
$query ="Select * FROM `news` orDER BY `id` DESC LIMIT ".($page-1)*$page_count.","."$page_size";
$result = mysql_query($query);
?>
<table width="559" border="0" align="left" cellpadding="0" cellspacing="2">
<?php
while($l_result = mysql_fetch_array($result))
{
?>
<tr>
<td width="43"><div align="center">
<?php
if (($l_result['lx'] == "xitong")){ echo ("<img src='images/66.gif'>");}
elseif (($l_result['lx'] == "gengxin")){ echo ("<img src='images/67.gif'>");}
elseif (($l_result['lx'] == "zhongyao")){ echo ("<img src='images/68.gif'>");}
elseif (($l_result['lx'] == "bagua")){ echo ("<img src='images/73.gif'>");}
elseif (($l_result['lx'] == "ceshi")){ echo ("<img src='images/70.gif'>");}
elseif (($l_result['lx'] == "huodong")) { echo ("<img src='images/72.gif'>");}
?>
</div></td>

<td width="307" align="left"><div align="center"><a href="<?php echo "?page=view&id"."=".$l_result['id'];?>"><?php echo $l_result['title'];?></a><a href="<?php echo "?page=view&id"."=".$l_result['id'];?>"></a></div></td>
<td width="300" align="left"><div align="left"><a href="<?php echo "?page=view&id"."=".$l_result['id'];?>"></a><a href="<?php echo "?page=view&id"."=".$l_result['id'];?>"></a><a href="<?php echo "?page=view&id"."=".$l_result['id'];?>"><?php echo $l_result['p_time'];?></a></div></td>
</tr>
<?php
}
?>

最佳答案
  • 五星知识达人网友:狂恋
  • 2021-05-14 08:48

有的像是改角色中文名的代码

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯