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


PHP ADODB_Session_Key函数代码示例

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


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

示例1: adodb_sess_write

    function adodb_sess_write($key, $val)
    {
        $Crypt = new MD5Crypt();
        global $ADODB_SESS_INSERT, $ADODB_SESS_CONN, $ADODB_SESS_LIFE, $ADODB_SESSION_TBL, $ADODB_SESSION_EXPIRE_NOTIFY;
        $expiry = time() + $ADODB_SESS_LIFE;
        // encrypt session data..
        $val = $Crypt->Encrypt(rawurlencode($val), ADODB_Session_Key());
        $arr = array('sesskey' => $key, 'expiry' => $expiry, 'data' => $val);
        if ($ADODB_SESSION_EXPIRE_NOTIFY) {
            $var = reset($ADODB_SESSION_EXPIRE_NOTIFY);
            global ${$var};
            $arr['expireref'] = ${$var};
        }
        $rs = $ADODB_SESS_CONN->Replace($ADODB_SESSION_TBL, $arr, 'sesskey', $autoQuote = true);
        if (!$rs) {
            ADOConnection::outp('
-- Session Replace: ' . $ADODB_SESS_CONN->ErrorMsg() . '</p>', false);
        } else {
            // bug in access driver (could be odbc?) means that info is not commited
            // properly unless select statement executed in Win2000
            if ($ADODB_SESS_CONN->databaseType == 'access') {
                $rs = $ADODB_SESS_CONN->Execute("select sesskey from {$ADODB_SESSION_TBL} WHERE sesskey='{$key}'");
            }
        }
        return isset($rs);
    }
开发者ID:jin255ff,项目名称:company_website,代码行数:26,代码来源:adodb-cryptsession.php

示例2: adodb_sess_write

 function adodb_sess_write($key, $val)
 {
     $Crypt = new MD5Crypt();
     global $ADODB_SESS_INSERT, $ADODB_SESS_CONN, $ADODB_SESS_LIFE, $ADODB_SESSION_TBL;
     $expiry = time() + $ADODB_SESS_LIFE;
     // encrypt session data..
     $val = $Crypt->Encrypt(rawurlencode($val), ADODB_Session_Key());
     $qry = "UPDATE {$ADODB_SESSION_TBL} SET expiry={$expiry},data='{$val}' WHERE sesskey='{$key}'";
     $rs = $ADODB_SESS_CONN->Execute($qry);
     if ($rs) {
         $rs->Close();
     } else {
         print '<p>Session Update: ' . $ADODB_SESS_CONN->ErrorMsg() . '</p>';
     }
     if ($ADODB_SESS_INSERT || $rs === false) {
         $qry = "INSERT INTO {$ADODB_SESSION_TBL}(sesskey,expiry,data) VALUES ('{$key}',{$expiry},'{$val}')";
         $rs = $ADODB_SESS_CONN->Execute($qry);
         if ($rs) {
             $rs->Close();
         } else {
             print '<p>Session Insert: ' . $ADODB_SESS_CONN->ErrorMsg() . '</p>';
         }
     }
     // bug in access driver (could be odbc?) means that info is not commited
     // properly unless select statement executed in Win2000
     if ($ADODB_SESS_CONN->databaseType == 'access') {
         $rs = $ADODB_SESS_CONN->Execute("select sesskey from {$ADODB_SESSION_TBL} WHERE sesskey='{$key}'");
     }
     return isset($rs);
 }
开发者ID:qoire,项目名称:portal,代码行数:30,代码来源:adodb-cryptsession.php


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