页面间传值问题在线等

tksnow 2004-04-01 08:39:13
着是前一页
<?
$sql_news="select * from News Where Zlm_Id='1' Order By New_Id Desc ";
$Result=mssql_query($sql_news);
$Num=0; //显示的记录数
While ($arr=mssql_fetch_row($Result) and $Num<5)
{

?>
<font size=2><img border="0" src="images/images1/huangk.gif" width="5" height="5">
<a href="news/news.php?New_Id=<? Echo $arr[0];?>&Bk_Id=<?Echo $arr[5]?>"><? Echo $arr[3];?></a></font><br>
<?
$Num=$Num+1;
}
?>
                                            
<font size="2"><a target="_self" href="news/Index.php?Zlm_Id=1">>> 更多 </a> </font>

这是news.php页

<html>

<head>

</head>

<body bgColor="#FFFFFF" leftMargin="5" topMargin="4" marginwidth="5" marginheight="5"
<?require("../conn.php");?>
<?
// echo $New_Id;
// echo $dl;
// echo $bkfl;
$sql_show="Select * From News where New_Id='$New_Id' and Bk_Id='$Bk_Id'";
$Result=mssql_query($sql_show);

$obj=mssql_fetch_object($Result);

$Title=$obj->Title;
$Date_Time=$obj->Date_Time;
$Author=$obj->Author;
$Nr=$obj->Nr;
$Pic=$obj->Pic;
$LaiYuan=$obj->LaiYuan;

echo "aaa",$New_Id,$Bk_Id,$Nr;
require("../disconn.php");
?>
</body>
</html>
为什么$New_Id,$Bk_Id,的值传不到调用页news.php

各位帮忙.
...全文
176 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
ice_berg16 2004-04-02
  • 打赏
  • 举报
回复
$sql_show="Select * From News where New_Id='".$_GET['New_Id']."' and Bk_Id='".$_GET['Bk_Id']."'";
52juanjuan 2004-04-02
  • 打赏
  • 举报
回复
可以定义一个<form>通过<form>来传递表单的值,也可以通过session,还可以用全局变量
memoth 2004-04-02
  • 打赏
  • 举报
回复
$_GET['']是一个问题
还有, While ($arr=mssql_fetch_row($Result) and $Num<5)
如果取出来的记录数为零,那么$arr[]里没有值,当然也传过去也是空的
haojiubujian 2004-04-01
  • 打赏
  • 举报
回复
news里面要个传的变量调出来,$aaa=&_GET['变量'];
你以为它自己会传递啊?搞笑!
用session也可以!不过麻烦一些!
结贴吧!
tksnow 2004-04-01
  • 打赏
  • 举报
回复
用session怎么看?
boystones 2004-04-01
  • 打赏
  • 举报
回复
用session,看一下他的用法

21,893

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧