InfoQ

交流

讨论:session提示错误,怎么回事啊?

作者 wohugb 发布于 2003-09-02 分类:php基础编程

源码如下: <? /* ------------------------------------------------------------------------ * test.php * ------------------------------------------------------------------------ * PHP4 Customer Session Handler Test Script * Version 1.00 * by Ying Zhang (ying@zippydesign.com) * Last Modified: May 21 2000 */ /* default to DBM handler */ if (! Isset($handler)) { $handler = "mysql"; } /* default action is increment */ if (! Isset($action)) { $action = "increment"; } /* load up the appropriate session handling script, depending on the handler */ if ($handler == "dbm") { include("session_dbm.php"); } elseif ($handler == "mysql") { include("session_mysql.php"); } else { echo "

  • Unrecognized handler ($handler)"; die; } /* start the session and register a simple counter */ session_start(); session_register("count"); /* figure out what we should do, depending on the action */ switch ($action) { case "increment" : $count = isset($count) ? $count + 1 : 0; break; case "destroy" : session_destroy(); break; case "gc" : $maxlife = get_cfg_var("session.gc_maxlifetime"); sess_gc($maxlife); break; default: echo "
  • Unknown action ($action)"; break; } ?> 无标题文档

    Session Test Script

    • Handler: <?=$handler?>
    • Action: <?=$action?>
    • Count: <?=$count?>

    Handler:
    Action:



    逛论坛交流session提示错误,怎么回事啊?

    加入书签
    digg+,
    reddit+,
    del.icio.us+,
    dzone+

    10 条回复

    回复

      发表人 991149689 发表于 09月24日
    session_start(); 前不能有输出 发表人 tmyu 发表于 09月24日
    Warning: Cannot send session cookie .. 发表人 wohugb 发表于 09月24日
    谢谢 试试 发表人 wohugb 发表于 09月24日
      发表人 991149689 发表于 09月24日
    <? /* -------------------------.. 发表人 wohugb 发表于 09月24日
    把设置session放在最前面 发表人 tmyu 发表于 09月24日
    Warning: Cannot send session cookie .. 发表人 wohugb 发表于 09月24日
    错误提示没了 可是程序不好用了 发表人 wohugb 发表于 09月24日
    QUOTE: 发表人 wohugb 发表于 09月24日
    1. 返回顶部

      Re: session提示错误,怎么回事啊?

      2003年09月24日 发表人 991149689

       

    2. session_start();
      前不能有输出

    3. 返回顶部

      Re: session提示错误,怎么回事啊?

      2003年09月24日 发表人 wohugb

      Warning: Cannot send session cookie - headers already sent by (output started at D:servervipgbsession_mysql.php:164) in D:servervipgb est.php on line 34

      Warning: Cannot send session cache limiter - headers already sent (output started at D:servervipgbsession_mysql.php:164) in D:servervipgb est.php on line 34

    4. 返回顶部

      Re: session提示错误,怎么回事啊?

      2003年09月24日 发表人 wohugb

      谢谢 试试

    5. 返回顶部

      Re: session提示错误,怎么回事啊?

      2003年09月24日 发表人 991149689

       

    6. 返回顶部

      Re: session提示错误,怎么回事啊?

      2003年09月24日 发表人 wohugb

      <? /* ------------------------------------------------------------------------ * test.php * ------------------------------------------------------------------------ * PHP4 Customer Session Handler Test Script * Version 1.00 * by Ying Zhang (ying@zippydesign.com) * Last Modified: May 21 2000 */ /* default to DBM handler */ if (! Isset($handler)) { $handler = "dbm"; } /* default action is increment */ if (! Isset($action)) { $action = "increment"; } /* load up the appropriate session handling script, depending on the handler */ if ($handler == "dbm") { include("session_dbm.php"); } elseif ($handler == "mysql") { include("session_mysql.php"); } else { $echo="

    7. Unrecognized handler ($handler)"; die; } /* start the session and register a simple counter */ session_start(); session_register("count"); /* figure out what we should do, depending on the action */ switch ($action) { case "increment" : $count = isset($count) ? $count + 1 : 0; break; case "destroy" : session_destroy(); break; case "gc" : $maxlife = get_cfg_var("session.gc_maxlifetime"); sess_gc($maxlife); break; default: echo "
    8. Unknown action ($action)"; break; } ?>

      Session Test Script

      • Handler: <?=$handler?>
      • Action: <?=$action?>
      • Count: <?=$count?>

      Handler:
      Action:

      <? if($echo) {echo ""; echo ""; echo ""; echo ""; echo "
      "; echo $echo; echo "
      "; } ?>

  • 把设置session放在最前面

  • 返回顶部

    Re: session提示错误,怎么回事啊?

    2003年09月24日 发表人 wohugb

    Warning: Cannot send session cookie - headers already sent by (output started at D:servervipgbsession_dbm.php:112) in D:servervipgb est.php on line 34

    Warning: Cannot send session cache limiter - headers already sent (output started at D:servervipgbsession_dbm.php:112) in D:servervipgb est.php on line 34

    Fatal error: Call to undefined function: dbmopen() in D:servervipgbsession_dbm.php on line 48

    Fatal error: Call to undefined function: dbmclose() in D:servervipgbsession_dbm.php on line 55

  • 返回顶部

    Re: session提示错误,怎么回事啊?

    2003年09月24日 发表人 wohugb

    错误提示没了 可是程序不好用了

  • 返回顶部

    Re: session提示错误,怎么回事啊?

    2003年09月24日 发表人 wohugb


    QUOTE:




  • 我有话要讲:(可以匿名发表, 发广告的有多远请滚多远!!!)

    昵称: 请输入验证码:


  • 抢着回答

    二个日期的比较,如何得到二个时期相差...

    2003-09-12 2003-12-12 如何得到二个时期相差的天数?

    having 和 where 的区别主要是在哪里.

    如猪蹄.

    取数据的问题

    我有一张信息发布表,信息有三个类型:供应,求购,合作。 我想...

    请问诸位用什么技术建站的?

    我只知道PHP+PHPLIB。 那种更好用?

    这种分页好做吗?

    就是一页文字(可能有图片,不方便先不考虑)如果文字达到一定限度,...

    测测你的心理年龄

    http://www.xlzx.com/xlcs/zy32.htm 喵的说我28岁! 21岁...

    加法

    一张一张慢慢地贴 太多怕消化不了

    冬冬大侠!你短信要删了

    都满了

    怎么得到居域网用户的ip地址?

    如题

    高手来看! 这样使用 中文字段 有问题没...

    先将 中文字符 转换成 MYSQL能接受的 字符编码, 然后用的时候...

    []