日期:2013-11-29  浏览次数:20421 次

<?php
ob_start();
session_start();
class CC{
    private $REFURL="http://www.abc.com";        //登陆成功后转换页面
    private $LoginFLAG=false;                //登陆成功标志
    private $loginFILE="loginmsg.txt";            //信息文件

    function setFlag($flag){
        $this->loginFLAG=$flag;
    }
    function check(){
    global $_POST;
        if(file_exists($this->loginFILE)&& (time()-filemtime($this->loginFILE))<60){//用户登陆存在而且有效
            $info=file($this->loginFILE);
            $username=trim($info[0]);    //已在线的登陆用户名
            $password=trim($info[1]);    //已在线密码(可以不保存)
            $ip     =trim($info[2]);    //已在线IP
            $sid     =trim($info[3]);    //已在线PORT
            if(strcmp($_SESSION[LoginUser],$username)==0){
                if(strcmp($_SESSION['LoginPw'],$password)==0){
                    if(strcmp($_SERVER[REMOTE_ADDR],$ip)==0){
                        if(strcmp(session_id(),$sid)==0){
                            $this->setFlag(true);
                            echo "<h3>您的帐户可以确定是唯一的!</h3>";
                            $cf=fopen($this->loginFILE,"a+");
                            fputs($cf,"\r\na");
                            fclose($cf);
                            echo "<meta http-equiv=refresh content=\"10;url=t.php\">";
                            //echo "<iframe src=\"t.php\" frameborder=0 width=0 height=0></iframe>";
                        }else{
     &n