当前位置: 首页>>代码示例>>PHP>>正文


PHP session_unregister函数代码示例

本文整理汇总了PHP中session_unregister函数的典型用法代码示例。如果您正苦于以下问题:PHP session_unregister函数的具体用法?PHP session_unregister怎么用?PHP session_unregister使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了session_unregister函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: chkinput

 function chkinput()
 {
     if (strval($this->xym) != $_SESSION["autonum1"]) {
         echo "<script>alert('验证码输入错误!');history.go(-1);</script>";
         exit;
     }
     include_once "conn/conn.php";
     $sql = mysql_query("select usernc from tb_user where usernc='" . $this->usernc . "'", $conn);
     $info = mysql_fetch_array($sql);
     if ($info == false) {
         echo "<script>alert('对不起,不存在该用户!');history.back();</script>";
         exit;
     } else {
         $sql = mysql_query("select usernc from tb_user where usernc='" . $this->usernc . "' and pwd='" . $this->userpwd . "'", $conn);
         $info = mysql_fetch_array($sql);
         if ($info == false) {
             echo "<script>alert('对不起,密码输入错误!');history.back();</script>";
             exit;
         } else {
             //date_default_timezone_set("Asia/Hong_Kong");
             $lastlogintime = date("Y-m-j H:i:s");
             mysql_query("update tb_user set lastlogintime='" . $lastlogintime . "',logintimes=logintimes+1 where usernc='" . $this->usernc . "'", $conn);
             if ($_SESSION["unc"] != "") {
                 session_unregister("unc");
             }
             session_register("unc");
             $_SESSION["unc"] = $this->usernc;
             echo "<script>alert('登录成功!');history.back();</script>";
         }
     }
     mysql_close($conn);
 }
开发者ID:noikiy,项目名称:web,代码行数:32,代码来源:dl.php

示例2: logout

function logout()
{
    session_unregister("password");
    session_unregister("sessid");
    session_destroy();
    die("Not logged in");
}
开发者ID:victorngkp,项目名称:core_cms,代码行数:7,代码来源:admin_session.php

示例3: errorHandler

function errorHandler($errno, $errstr, $errfile, $errline)
{
    switch ($errno) {
        case E_USER_NOTICE:
        case E_USER_WARNING:
        case E_WARNING:
        case E_NOTICE:
        case E_CORE_WARNING:
        case E_CORE_NOTICE:
        case E_COMPILE_WARNING:
            break;
        case E_USER_ERROR:
        case E_ERROR:
        case E_PARSE:
        case E_CORE_ERROR:
        case E_COMPILE_ERROR:
            session_start();
            if (session_is_registered("message")) {
                session_unregister("message");
            }
            if (session_is_registered("order_no")) {
                session_unregister("order_no");
            }
            $errorString = "Ride board system error: {$errstr} (# {$errno}).<br>\n" . "Please report the following to the administrator:<br>\n" . "Error in line {$errline} of file {$errfile}.<br>\n";
            // Send the error to the administrator by email
            error_log($errorString, 1, "kuper");
            ?>
        <?php 
            // Stop the system
            die("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n            \"http://www.w3.org/TR/html4/loose.dtd\">\n          <html>\n          <head>\n          <title>Ride Board</title>\n          <link rel=\"stylesheet\" type=\"text/css\" href=\"login.css\">\n          <META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">\n          </head>\n          <body>\n          <div id=\"content\">\n          The rideboard database is temporarily unavailable.<br><br>\n          {$errorString}\n          </div>\n          </body>\n          </html>");
        default:
            break;
    }
}
开发者ID:acohn,项目名称:grinnellplans-php,代码行数:34,代码来源:inc-error.php

示例4: check_input

 function check_input()
 {
     if (strval($this->tb_validate) != $_SESSION["validate1"]) {
         echo "<script>alert('验证码输入错误!');history.go(-1);</script>";
         exit;
     }
     include_once "conn/conn.php";
     $sql = mysql_query("select tb_forum_user from tb_forum_user where tb_forum_type=2 and tb_forum_user='" . $this->tb_user . "'", $conn);
     $info = mysql_fetch_array($sql);
     if ($info == false) {
         echo "<script>alert('对不起,不存在该用户!');history.back();</script>";
         exit;
     } else {
         $sql = mysql_query("select tb_forum_user from tb_forum_user where tb_forum_type=2 and tb_forum_user='" . $this->tb_user . "' and tb_forum_pass='" . $this->tb_pass . "'", $conn);
         $info = mysql_fetch_array($sql);
         if ($info == false) {
             echo "<script>alert('对不起,密码输入错误!');history.back();</script>";
             exit;
         } else {
             if ($_SESSION["admin_user"] != "") {
                 session_unregister("admin_user");
             }
             session_register("admin_user");
             $_SESSION["admin_user"] = $this->tb_user;
             echo "<script>alert('登录成功!');window.location.href='index.php';</script>";
         }
     }
     mysql_close($conn);
 }
开发者ID:Arrray,项目名称:PHPpractice,代码行数:29,代码来源:enter_manage_ok.php

示例5: testSessionUnregister

 public function testSessionUnregister()
 {
     session_register("TESTES_#3");
     $this->assertTrue(session_is_registered("TESTES_#3"));
     session_unregister("TESTES_#3");
     $this->assertFalse(session_is_registered("TESTES_#3"));
 }
开发者ID:dbseller,项目名称:legacy,代码行数:7,代码来源:EmulateTest.php

示例6: kill_session_var

function kill_session_var($var_name) {
	/* register_global = off: reset local settings cache so the user sees the new settings */
	session_unregister($var_name);

	/* register_global = on: reset local settings cache so the user sees the new settings */
	unset($_SESSION[$var_name]);
}
开发者ID:songchin,项目名称:Cacti,代码行数:7,代码来源:session.php

示例7: destroy

 function destroy($name)
 {
     if (isset($_SESSION[$name])) {
         session_unregister($name);
         unset($_SESSION[$name]);
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:7,代码来源:session.class.php

示例8: f_abmelden

/**
 * Session löschen wenn sich der Userabmeldet
 */
function f_abmelden()
{
    session_unregister("userpass");
    //Variablen aus der Session löschen
    session_unregister("username");
    session_destroy();
    //Session verwerfen -sie hat es nie gegeben (Aufräumen)
}
开发者ID:BackupTheBerlios,项目名称:mct-svn,代码行数:11,代码来源:functionsClasses.php

示例9: s_del

 function s_del($name)
 {
     $new_name = $this->s_var_prefix . $name;
     unset($_SESSION[$new_name]);
     if (ini_get('register_globals')) {
         session_unregister($new_name);
     }
 }
开发者ID:altima-au,项目名称:wp-lookbook-free,代码行数:8,代码来源:alfw_s_session.php

示例10: doLogout

function doLogout()
{
    if (function_exists('session_unregister')) {
        @session_unregister('clone');
    }
    unset($_SESSION['clone']);
    mosRedirect("index.php?option=com_cloner", "");
}
开发者ID:noikiy,项目名称:owaspbwa,代码行数:8,代码来源:cloner.functions.php

示例11: closeSale

 function closeSale()
 {
     //deletes sessions vars
     session_unregister('items_in_sale');
     session_unregister('current_sale_customer_id');
     session_unregister('current_item_search');
     session_unregister('current_customer_search');
 }
开发者ID:bravia2015,项目名称:c2t-pos,代码行数:8,代码来源:security_functions.php

示例12: del

 /**
  * Removes a var from the session. Take also care on the global
  * scope.
  *
  * @param string $name The name of the var
  */
 function del($name)
 {
     if (empty($name)) {
         return false;
     }
     session_unregister($name);
     $_SESSION[$name] = NULL;
     return true;
 }
开发者ID:BackupTheBerlios,项目名称:smart-svn,代码行数:15,代码来源:SmartCommonSession.php

示例13: unsetSessionVar

 /**
  * Unset (delete) a session variable.
  * @param $key string
  */
 function unsetSessionVar($key)
 {
     if (isset($_SESSION[$key])) {
         unset($_SESSION[$key]);
     }
     if (session_is_registered($key)) {
         session_unregister($key);
     }
 }
开发者ID:ramonsodoma,项目名称:pkp-lib,代码行数:13,代码来源:Session.inc.php

示例14: set_session

function set_session($param_name, $param_value)
{
    global ${$param_name};
    if (session_is_registered($param_name)) {
        session_unregister($param_name);
    }
    ${$param_name} = $param_value;
    session_register($param_name);
}
开发者ID:kractos26,项目名称:orfeo,代码行数:9,代码来源:common.php

示例15: checkLogin

function checkLogin()
{
    if (!session_is_registered('admin')) {
        session_unregister('admin');
        header('location: login.php');
    } else {
        header('location: index.php');
    }
}
开发者ID:aile54,项目名称:akachan,代码行数:9,代码来源:common.php


注:本文中的session_unregister函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。