首页 Soft PlugIn RAN乱 Dev开发 Info资料 English WAP 留言 登陆 注册
-
Posted by Yippee | 评论(0) | 引用(0) | 阅读2067次
session_start 空白页

一个简单的  session 使用
<?
session_start();
//注册一个session变量
session_register('counter');
//增加计数器
$counter++;
echo "You have visited this page $counter times! Don't you have anything else to do, you bum?!";

//session_start();
//session_register('count');
//$count++;
//echo "<P>You've been here $count times.</p>";
?>

session_start -- Initialize session data
bool session_start ( void )
session_start() creates a session or resumes the current one based on the current session id that's being passed via a request, such as GET, POST, or a cookie.
This function always returns TRUE.
注: If you are using cookie-based sessions, you must call session_start() before anything is outputted to the browser.

session_register --  Register one or more global variables with the current session
bool session_register ( mixed name [, mixed ...] )
session_register() accepts a variable number of arguments, any of which can be either a string holding the name of a variable or an array consisting of variable names or other arrays. For each name, session_register() registers the global variable with that name in the current session.

结果
调试警告 - Unknown(): Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively.

声明:O:\php\Apache Group\Apache2\htdocs\t1\t2.php 行 6 - Undefined variable:  counter

访问的时候一片空白,源码成了这样

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312"></HEAD>
<BODY></BODY></HTML>

不知道是不是由于我修改了PHP.INI?或者ZEND自己又一套PHP,两个乱七八糟的
错误应用程序 Apache.exe,版本 2.0.54.0,错误模块 ntdll.dll,版本 5.1.2600.1106,错误地址 0x000267cd。

反正我决定彻底的重新安装一遍。

ZEND不再自行安装新的PHP,直接使用原安装的。


字体:

Permanant URI永久地址 http://www.shengfang.org/blog/p/session_startblank.php
Trackback URI引用地址 http://www.shengfang.org/blog/tb.php?tb_id=1124064967

2005年8月15日08:16星期一  [Dev开发] 追踪此文的RSS
提示:
此文还没有评论。

称呼:    登陆   注册
   不注册,但记住我的信息
邮件:
(非必须)
评论: [UBB代码帮助]
粗体 斜体 下划线 链接 水平线 引用



验证码: 请输入你看见的数字
关闭UBB      提交时自动将内容复制到剪贴板

公告
Fire and Motion!

统计信息
[Yippee]||[统计]||日志:1790
在线: 20||用户: 2562 [列表]
今日:2156||到访:2671655
Rss:838442||评论:1584

最新日志

最新评论

友情链接

日历

最新引用

搜索

归档

杂项
Get RSS Feed (Version 2.0)
Get Atom Feed (Version 0.3)
编码:  UTF-8