本文整理汇总了PHP中BD::isInDb方法的典型用法代码示例。如果您正苦于以下问题:PHP BD::isInDb方法的具体用法?PHP BD::isInDb怎么用?PHP BD::isInDb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BD
的用法示例。
在下文中一共展示了BD::isInDb方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: BD
<?php
session_start();
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
require_once '../Config.class.php';
require_once '../../../app/Bd.class.php';
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-type: application/json');
extract($_GET);
$BD = new BD('user');
if ($BD->isInDb('pseudo', $pseudo)) {
$user = $BD->select('pseudo', $pseudo);
if ($user->passwd == sha1($password)) {
$BD->setUsedTable('connecté');
if (!$BD->isInDb('iduser', $user->iduser)) {
$BD->addCo($user->iduser);
$_SESSION['pseudo'] = $pseudo;
$_SESSION['iduser'] = $user->iduser;
$energy = $user->energie / $user->maxenergie * 100;
$_SESSION['energie'] = $energy;
$_SESSION['money'] = $user->money;
$_SESSION['avatar'] = $user->avatar;
$_SESSION['rang'] = $user->rang;
$error = "Ok";
} else {
$error = "Vous etes déja connecté !";
}
} else {
$error = "Mot de passe incorecte !";
示例2: header
<?php
if (isset($_SESSION['login'])) {
header('Location : index.php');
exit;
}
require_once Config::$path['model'] . 'login.php';
if (isset($_POST['login'])) {
$BD = new BD('user');
if ($BD->isInDb("pseudo", $_POST['pseudo']) && (($User = $BD->select("pseudo", $_POST['pseudo'])) && $User->pass == sha1($_POST['password'])) && $User->rang != 0) {
$BD->update("online", 1, "pseudo", $_POST['pseudo']);
$iduser = $BD->select("pseudo", $_POST['pseudo']);
$_SESSION['rang'] = $iduser->rang;
$_SESSION['iduser'] = $iduser->iduser;
$_SESSION['avatar'] = $iduser->avatar;
$_SESSION['pseudo'] = htmlentities($_POST['pseudo']);
$_SESSION['login'] = 'ok';
$_SESSION['msg'][0] = 'success';
$_SESSION['msg'][1] = "Vous êtes connecté !";
header('Location: index.php');
} else {
echo "<div class='error'>Echec de connexion !!! </div>";
}
}
require_once Config::$path['views'] . 'login.php';
示例3: json_encode
<?php
session_start();
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
require_once '../Config.class.php';
require_once '../Bd.class.php';
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-type: application/json');
$BD = new BD('connecté');
$userCo = $BD->isInDb('iduser', $_SESSION['iduser']);
echo json_encode($userCo);
示例4: isMailInDb
function isMailInDb($Mail)
{
$BD = new BD("user");
return $BD->isInDb("mail", $Mail);
}
示例5: isForumInDb
function isForumInDb($nom)
{
$BD = new BD('forum');
return $BD->isInDb('nom', $nom);
}
示例6: json_encode
<?php
session_start();
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
require_once '../../app/Config.class.php';
require_once '../../app/Bd.class.php';
header('Cache-Control: no-cache, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Content-type: application/json');
extract($_GET);
$BD = new BD('user');
$return = $BD->isInDb($nom, $valeur);
echo json_encode($return);