最好将两个页面的代码全部贴出来。
比如说上面你根本没有对user_id赋值,第二个页面当然显示不了。
还有可能user_id跟其他变量名发生冲突等
比如说上面你根本没有对user_id赋值,第二个页面当然显示不了。
还有可能user_id跟其他变量名发生冲突等
解决方案 »
- php与ajax中的问题
- 关于javascript显示文件内容的问题
- MYSQL错误:Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (gbk_chinese_ci,COERCIBLE) for operation '='
- 一个奇怪的参数传递问题
- 这个页面地址是多少http://news.sohu.com/s2006/tvc20/
- 求助登录问题
- PHP的分页显示问题!急
- php4.3.9在连接MYSQL4.1.7出错,怎么回事? 请指教。
- 菜问:怎样统计点击次数?
- 请问:上传图片和操作数据库难道不能同时进行吗?
- 我想给我的网站增加一个找回密码的功能
- 关于判断访客地域的问题,高分,在线等待,大家一起研究
程序就这么简单,可是就是不行啊!!!!
我吐血!!!
关注中!
更改php.ini
register_global=on
试一试先
新版本都是off
第二个页面中,try:
session_start();
echo $HTTP_SESSION_VARS[user_id];
我的终极解决办法是直接分析session原文件!决不会出错!!!!
有兴趣的朋友请联系!
session_start();
$_SESSION["user_id"]++;第二个页面中:
session_start();
echo $_SESSION["user_id"];
session.save_handler = files ; handler used to store/retrieve data
;;;; #### **** modified {
session.save_path = C:/KedingSoft/php4/tmp ; argument passed to save_handler
;;;; #### **** }
; in the case of files, this is the
; path where data files are stored
session.name = PHPSESSID
; name of the session
; is used as cookie name
session.auto_start = 1 ; initialize session on request startup
session.serialize_handler = php ; handler used to serialize data
; php is the standard serializer of PHP
session.gc_probability = 1 ; percentual probability that the
; 'garbage collection' process is started
; on every session initialization
session.gc_maxlifetime = 1440 ; after this number of seconds, stored
; data will be seen as 'garbage' and
; cleaned up by the gc process
session.referer_check = ; check HTTP Referer to invalidate
; externally stored URLs containing ids
session.entropy_length = 0 ; how many bytes to read from the file
session.entropy_file = ; specified here to create the session id
; session.entropy_length = 16
; session.entropy_file = /dev/urandom
session.cache_limiter = nocache ; set to {nocache,private,public} to
; determine HTTP caching aspects
session.cache_expire = 180 ; document expires after n minutes;;;; #### **** modified {
session.use_cookies = 0 ; whether to use cookies
session.cookie_lifetime = 99999999999999999 ; lifetime in seconds of cookie
; or if 0, until browser is restarted
session.cookie_path = / ; the path the cookie is valid for
session.cookie_domain = ; the domain the cookie is valid for
session.use_trans_sid = 1 ; use transient sid support if enabled
; by compiling with --enable-trans-sid
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
;;;; #### **** }
將session.use_cookies = 0
改為1$HTTP_SESSION_VARS[]是在php4以後的
其他以前php3就有
就是反复改那几个设置,不行了再改,一不小心,好了!我吐血!
不过对session的问题还不是很清楚,大家可以继续讨论,都有分的。
我觉得php的session做的好麻烦哦,想想asp、asp.net的session多么方便啊。
session.use_cookies = 1
session.use_cookies = 1
2 session_start=on