本文整理汇总了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);
}
示例2: logout
function logout()
{
session_unregister("password");
session_unregister("sessid");
session_destroy();
die("Not logged in");
}
示例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;
}
}
示例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);
}
示例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"));
}
示例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]);
}
示例7: destroy
function destroy($name)
{
if (isset($_SESSION[$name])) {
session_unregister($name);
unset($_SESSION[$name]);
}
}
示例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)
}
示例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);
}
}
示例10: doLogout
function doLogout()
{
if (function_exists('session_unregister')) {
@session_unregister('clone');
}
unset($_SESSION['clone']);
mosRedirect("index.php?option=com_cloner", "");
}
示例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');
}
示例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;
}
示例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);
}
}
示例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);
}
示例15: checkLogin
function checkLogin()
{
if (!session_is_registered('admin')) {
session_unregister('admin');
header('location: login.php');
} else {
header('location: index.php');
}
}