session丢失一问(很急,大家帮忙)

als0470 2006-01-03 03:55:02
// shopping1.php shopping2.php -- shopping5.php就是PageID不同,分别是2-5
<form action="shopping6.php" method="get"input type=hidden name=PageID value="1"><input type=hidden name=action value="a">
You have
<?php
//session_start();
if (!session_is_registered('cart_item')) {
session_register('cart_item');
$cart_item=0;
echo $cart_item." unreg ";
}
else {
echo $HTTP_SESSION_VARS['cart_item']." reg ";
}
?>
item(s) in your Shopping Cart
</b>
</form>
我在这我个页面跳转的时候(页面上有link相联),有的时候会发生session('cart_item')丢失.有的时候又是好的.请问怎么解决
环境保护: php4.03pl1 +Linux lenw2.2 + apache 1.3.14
这个代码在windows2000+iis+php5.1下面不会发生这个问题
...全文
122 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
als0470 2006-01-04
  • 打赏
  • 举报
回复
我现在无法升级服务器,请问我要改cookie的话要怎么做
als0470 2006-01-04
  • 打赏
  • 举报
回复
这样不行啊,配置见http://try.webex.com/meet/test/session/land.php 我要怎么修改啊
xuzuning 2006-01-04
  • 打赏
  • 举报
回复
php4.03pl1 ???
请升级你的php!
php4.03pl1 才开始出现session不久,出现问题是难免的
Fibona 2006-01-03
  • 打赏
  • 举报
回复
这样试试看
<?php
session_start();
if (!session_is_registered('cart_item')) {
session_register('cart_item');
$HTTP_SESSION_VARS["cart_item"]=0;
echo $HTTP_SESSION_VARS["cart_item"]." unreg ";
}
else {
echo $HTTP_SESSION_VARS['cart_item']." reg ";
}
?>
zairwolft 2006-01-03
  • 打赏
  • 举报
回复
"><input type=hidden name=action value="a">
You have
怎么在session_start前面?
als0470 2006-01-03
  • 打赏
  • 举报
回复
<?php session_start();?>已写在页面刚开始的地方了

21,893

社区成员

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

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