日期:2014-05-17  浏览次数:20581 次

php 传值的问题 求高手
<form name="form" method="post" action="">
  <table width="560" height="430" border="0" align="center" cellpadding="0" cellspacing="0" id="__01">
   
  <tr>
 
  <td valign="top"><table width="60%" border="0" align="center">
  <tr>
  <td width="94"><div align="center" class="STYLE1">标题</div></td>
  <td width="264" height="40"><div align="center" class="STYLE1">作者</div></td>
  <td width="264" height="40"><div align="center" class="STYLE1">发布时间</div></td>
  </tr>
<?php
/*连接数据库*/
$conn=mysql_connect("localhost","root","111");
mysql_select_db("register",$conn);
mysql_query("set names utf8");
$arr=mysql_query("select * from luntan",$conn);
/*使用while语句循环mysql_fetch_array()函数返回的数组*/
while($result=mysql_fetch_array($arr)){
?>
  <tr>
  <td height="25" > <a href="clc.php?id= <?php echo $result["id"];?>"> <?php echo $result['bt'];?> </a>
   
  </td>
  <td height="25"><?php echo $result['zuozhe'];?>
   
  </td>
  <td height="25"><?php echo $result['fs'];?>
   
  </td>
  </tr>
<?php
  } //结束while循环
?>
  </table></td>
  </tr>
  </table>
</form>
我要在http://localhost/wosheji/lantan/clc.php?id= 6这个页面怎么看到id=6对应着的“内容”?

------解决方案--------------------
PHP code
....................连接数据库代码省略.............
$result=mysql_query("select * from 表名 where id=$_GET['id']");
$arr=mysql_fetch_assoc($result); 
print_r($arr);

------解决方案--------------------
在http://localhost/wosheji/lantan/clc.php?id= 6页面中加入
if(!empty($_GET)){
print_r($_GET);
}
看看输出什么,如果有id值,那么在if的表达式中加入#1的内容