>>>>>是类似于asp中的session("error_num")=number
     记录变量功能的东西,怎么实现?<<<<<<<

解决方案 »

  1.   

    session_start();
    if ( checkUser($username,$password)!=true ) {
        session_register("login_times");
        $login_times++;
        if ($login_times>3) {
           header("location:error.php");
           exit;
        }
        header("location:login.php");
        exit;
    }
    if (session_is_registered("login_times")) {
        session_unregister("login_times");
    }程序未经测试
      

  2.   

    是登陆后返回本页面吧?
    这个session 是写在登陆页面里的吗?(header里的?)
      

  3.   

    我觉得cookie实现不了,我同意qsnake的方法〉其实只要加上计数的功能!就可以判断是否出错!
      

  4.   

    为什么我用session_register会出现以下错误???Warning: Cannot send session cookie - headers already sent by (output started at E:\Soft Project\PHP\BBS System\index.php:5) in E:\Soft Project\PHP\BBS System\index.php on line 15Warning: Cannot send session cache limiter - headers already sent (output started at E:\Soft Project\PHP\BBS System\index.php:5) in E:\Soft Project\PHP\BBS System\index.php on line 15