本帖最后由 dancingmokey 于 2011-01-25 17:06:23 编辑

解决方案 »

  1.   

    你确定你的captcha.php没有代码错误?你贴的代码是错误的。
      

  2.   

    建议看一下PHP手册,在PHP4和PHP5中SESSION的一些函数已经发生了变化:Session 函数
    Table of Contents
    session_cache_expire — Return current cache expire
    session_cache_limiter — Get and/or set the current cache limiter
    session_commit — session_write_close 的别名
    session_decode — Decodes session data from a string
    session_destroy — Destroys all data registered to a session
    session_encode — 将当前会话数据编码为一个字符串
    session_get_cookie_params — Get the session cookie parameters
    session_id — Get and/or set the current session id
    session_is_registered — Find out whether a global variable is registered in a session
    session_module_name — Get and/or set the current session module
    session_name — Get and/or set the current session name
    session_regenerate_id — Update the current session id with a newly generated one
    session_register — Register one or more global variables with the current session
    session_save_path — Get and/or set the current session save path
    session_set_cookie_params — Set the session cookie parameters
    session_set_save_handler — Sets user-level session storage functions
    session_start — Initialize session data
    session_unregister — Unregister a global variable from the current session
    session_unset — Free all session variables
    session_write_close — Write session data and end session
      

  3.   

    建议看一下PHP手册,在PHP4和PHP5中SESSION的一些函数已经发生了变化:Session 函数
    Table of Contents
    session_cache_expire — Return current cache expire
    session_cache_limiter — Get and/or set the current cache limiter
    session_commit — session_write_close 的别名
    session_decode — Decodes session data from a string
    session_destroy — Destroys all data registered to a session
    session_encode — 将当前会话数据编码为一个字符串
    session_get_cookie_params — Get the session cookie parameters
    session_id — Get and/or set the current session id
    session_is_registered — Find out whether a global variable is registered in a session
    session_module_name — Get and/or set the current session module
    session_name — Get and/or set the current session name
    session_regenerate_id — Update the current session id with a newly generated one
    session_register — Register one or more global variables with the current session
    session_save_path — Get and/or set the current session save path
    session_set_cookie_params — Set the session cookie parameters
    session_set_save_handler — Sets user-level session storage functions
    session_start — Initialize session data
    session_unregister — Unregister a global variable from the current session
    session_unset — Free all session variables
    session_write_close — Write session data and end session
      

  4.   

    例如这个函数:session_is_registered
    (PHP 4, PHP 5)session_is_registered — Find out whether a global variable is registered in a session说明
    bool session_is_registered ( string $name )
    Finds out whether a global variable is registered in a session. Warning
    自 PHP 5.3.0 起,已经废弃此函数。强烈建议不要应用此函数 。
      

  5.   

    从 php4.1 开始 $_SESSION 已经可用public 类型声明只在 php5 可用
      

  6.   


    我在本地上重新用php4.3.8的环境试了一下, 跟server上的结果是一样的, 没有值返回.4.3下$_SESSION 不是和php5兼容了么....疯了要...