你调用setcookie后有没有提示设置失败?你在其它页面是怎么读取cookie变量的?最好用$_COOKIE['key']方式获取
解决方案 »
- 用html传表单值给PHP……迅雷就会自动打开下载
- 当$_GET['id']=""空的时候出现错误这是为什么呢。
- jQueryformValidator 如何将返回信息填入 onerror中
- ubb编辑器中的redo和undo应该怎么实现,急!!!
- 请问这种传递参数的方法是怎么实现的?
- PHP提交自动过滤掉input框内的指定字符,怎么写呢?
- 我想学PHP,不知道需要多久才能做出类似商业网站的程序?
- 如何使用PHP创建一个系统DSN,以便 通过ODBC访问Access数据库呢!或者 有没有其它好的方法。
- 網址編碼問題
- 请问大家,在CI中搜索分页,跳转其他页面时搜索的限制消失,显示总条数,是怎么回事啊?
- 若有重复的表格name,则值为哪个?
- 传值传不过来,怎么办??
如果不是请在设置cookie时设置cookie的有效路径
bool setcookie ( string name [, string value [, int expire [, string path [, string domain [, int secure]]]]])path
If set to '/', the cookie will be available within the entire domain. If set to '/foo/', the cookie will only be available within the /foo/ directory and all sub-directories such as /foo/bar/ of domain. The default value is the current directory that the cookie is being set in.
2、cookie默认doamin为/。即cookie在同一浏览器进程中对网站所有的页面有效
setcookie("right",mysql_result($result,0,'qx'));
setcookie("workname",mysql_result($result,0,'workname'));?>
<script language=javascript>
window.location.href='<?=$HTTP_SERVER_VARS['HTTP_REFERER'];?>';
</script>
我把生成cookie的文件放到跟目录下去了,cookie可以用了。现在的问题是我在我的机子上可以用,到别人的机子怎么也用不了啊!