本文整理汇总了PHP中SetSession函数的典型用法代码示例。如果您正苦于以下问题:PHP SetSession函数的具体用法?PHP SetSession怎么用?PHP SetSession使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetSession函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Signin
public function Signin($username, $password)
{
$userid = AuthFuncCheckUserSignin($username, $password);
if ($userid) {
$this->Load($userid);
SetSession("userid", $this->id);
SetSession("username", $this->username);
return true;
}
return false;
}
示例2: CustomSearch
/**
* Load a custom search
*/
public function CustomSearch()
{
SetSession('productsearch', (int) $_GET['searchId']);
if ($_GET['searchId'] > 0) {
$this->_customSearch = $GLOBALS['ISC_CLASS_ADMIN_CUSTOMSEARCH']->LoadSearch($_GET['searchId']);
$_REQUEST = array_merge($_REQUEST, $this->_customSearch['searchvars']);
}
if (isset($_REQUEST['new'])) {
$this->ManageProducts(GetLang('CustomSearchSaved'), MSG_SUCCESS);
} else {
$this->ManageProducts();
}
}
示例3: CopyOut
function CopyOut(&$a_vars, $a_fields = array())
{
//$s_db = "Session CopyOut:\n";
$n_copied = 0;
foreach ($this->_aAccessList as $s_var_name) {
if (isset($a_vars[$s_var_name])) {
if (empty($a_fields) || in_array($s_var_name, $a_fields)) {
SetSession($s_var_name, $a_vars[$s_var_name]);
//$s_db .= "$s_var_name='".GetSession($s_var_name)."'\n";
$n_copied++;
}
}
}
//SendAlert($s_db);
return $n_copied;
}
示例4: SetSession
<?php
include_once "../includes/session.php";
SetSession("AdminId", "");
header("Location: index.php");
示例5: users
$results = $connection->query($sql);
//test na existenciu užívateľa
if (empty($errors) && ($obj = $results->fetch_object())) {
$counts = $obj->count;
if ($counts > 0) {
$errors[] = "Užívateľ s emailom " . $email . " už existuje.";
}
}
if (empty($errors)) {
$sql = "insert into users (email,passcode,name,address) values('{$email}','{$password1}','{$name}','{$address}')";
$result = $connection->query($sql);
if (!$result) {
$errors[] = $connection->error;
} else {
$last_id = $connection->insert_id;
SetSession("UserId", $last_id);
header('Location: registerOK.php');
exit;
}
}
}
include_once "pageHeader.php";
?>
<div class="container">
<div class="row">
<div class="col-md-4">
<h2>Registrácia</h2>
<?php
if (!empty($errors)) {
示例6: CustomSearch
/**
* Perform a custom view search for shipments.
*/
private function CustomSearch()
{
if (!isset($_REQUEST['searchId'])) {
ob_end_clean();
header('Location: index.php?ToDo=viewShipments');
exit;
}
SetSession('shipmentsearch', (int) $_GET['searchId']);
$this->customSearch = $GLOBALS['ISC_CLASS_ADMIN_CUSTOMSEARCH']->LoadSearch($_GET['searchId']);
$_REQUEST = array_merge($_REQUEST, $this->customSearch['searchvars']);
$GLOBALS['BreadcrumEntries'][GetLang('CustomView')] = '';
$this->ManageShipments();
}
示例7: SetSession
$errors[] = "Zadajte email";
}
if ($password == "") {
$errors[] = "Zadajte heslo";
}
if ($email != "" && $password != "") {
$sql = "SELECT * FROM users WHERE email='{$email}'";
$results = $connection->query($sql);
if ($obj = $results->fetch_object()) {
$id = $obj->id;
$passcode = $obj->passcode;
$email = $obj->email;
if ($passcode != $password) {
$errors[] = "Nesprávne heslo.";
} else {
SetSession("UserId", $id);
header('Location: index.php');
exit;
}
} else {
//nenasli sme uzivatela s danym heslom
$errors[] = "Uživateľ neexistuje.";
}
}
}
include_once "pageHeader.php";
?>
<div class="container">
<div class="row">