“检查PHP $ _SESSION为空”问题 [英] "Check PHP $_SESSION empty" problem

查看:197
本文介绍了“检查PHP $ _SESSION为空”问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,有人可以向我解释这段代码有什么不对吗? ...(见图片代码或查看下方)


当我运行脚本应检查会话变量是否为空,如果是,则为其赋值。


下次脚本运行时(在同一页面会话中),

那么会话变量将不是空的意味着if语句不应该运行。

问题是无论会话变量是否具有值,它总是运行。

主脚本:

展开 | < span class =codeLinkonclick =selectAll(this);>选择 | 换行 | 行号

解决方案

我开始删除counter.php中的第1行。


感谢您的回复,但尝试过但仍无济于事...

您认为问题可能出在Hetzner的网络托管服务器上吗?



您认为问题可能出在Hetzner的网络托管服务器上吗?



我真的不知道。



如果添加<$ c,你会得到什么? $ C>的var_dump(


Hi all could someone please explain to me whats wrong with this code?...(see image for code or check bellow)

When I run the script it should check if the session variable is empty, if it is then give it a value.

The next time the script runs (in the same page session),
then the session variable will ofcourse not be empty meaning that the if statement should not run.
The problem is that is always runs no matter if the session variable has a value or not.

Main Script:

Expand|Select|Wrap|Line Numbers

解决方案

I''d start with deleting line #1 in counter.php.


Thanks for reply but tried that and still no avail...
Do you think the problem could be with Hetzner''s web hosting servers?


Do you think the problem could be with Hetzner''s web hosting servers?

I really don''t know.


what do you get if you add var_dump(


这篇关于“检查PHP $ _SESSION为空”问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆