本文整理汇总了PHP中Index::redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP Index::redirect方法的具体用法?PHP Index::redirect怎么用?PHP Index::redirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Index
的用法示例。
在下文中一共展示了Index::redirect方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: balans
$checkBalans = $db->select($queryCheckBalans);
if ($dbUserId == $sessionUserId) {
$totaalBedragInsert = $totaalBedrag[$sessionUserId];
}
if (count($checkBalans) > 0) {
$queryUpdateBalans = "UPDATE balans SET cost='{$cost[$dbUserId]}', debet='{$totaalBedragInsert}' WHERE user_id='{$dbUserId}' AND date='{$dbDate}'";
$db->update($queryUpdateBalans);
} else {
if ($cost[$dbUserId] != 0 || $totaalBedragInsert != 0) {
$queryInsertBalans = "INSERT INTO balans (user_id, cost, date, debet) VALUES ('{$dbUserId}', '{$cost[$dbUserId]}', '{$dbDate}' ,'{$totaalBedragInsert}')";
$db->insert($queryInsertBalans);
}
}
}
echo "<div class='alert alert-success' role='alert'><b>Afgerekend!</b></div>";
$index->redirect('index.php?page=bord');
} else {
$getId = $filter->getFilter('id');
$query = "SELECT * FROM user ORDER BY user.ancenniteit ASC";
$query2 = "SELECT * FROM balans WHERE id={$getId}";
$db->connect();
$results = $db->select($query);
$results2 = $db->select($query2);
foreach ($results2 as $result2) {
$date1 = strtotime($result2[date]);
$testDate = date('d M', $date1);
$totalDb = $result2['debet'];
}
?>
<div class='container'>
<form action='' method='post'>
示例2: logOut
function logOut()
{
session_destroy();
echo "<div class='alert alert-warning' role='alert'>Je bent nu uitgelogd.</div>";
$index = new Index();
$index->redirect('index.php');
}
示例3: Login
$title = "Log in";
if ($filter->getFilter('action') == 'forgotpass') {
include 'template/login_forgotpass.php';
} else {
$user = $filter->postFilter('user');
$pass = $filter->postFilter('pass');
$submit = $filter->postFilter('submit');
if ($_SESSION['loggedin'] == 1) {
echo 'Al ingelogd';
} else {
if ($submit) {
$login = new Login();
$login->checklogIn($user, $pass);
$url = 'index.php?page=bord';
$index = new Index();
$index->redirect($url);
echo "</div>";
} else {
?>
<body class="login-bg">
<div class="login-card" >
<h1>Log-in</h1><br>
<form method='post' action=''>
<input type="text" required='required' name="user" placeholder="Username">
<input type="password" required='required' name="pass" placeholder="Password">
<input type="submit" name="submit" class='btn btn-default' value="Login">
</form>
<div class="login-help">
<a href="index.php?page=login&action=forgotpass">Forgot Password</a>
示例4: Database
<div class='container-full'>
<?php
$db = new Database();
$index = new Index();
$filter = new Filter();
$dbDate = date('m/d/Y');
$dbTime = date("H:i:s");
$sessionUserId = $_SESSION[user_id];
if ($sessionUserId == "5" || $sessionUserId == "10" || $sessionUserId == "12" || $sessionUserId == "13" || $sessionUserId == "11") {
echo "<div class='alert alert-danger' role='alert'><b>Verboden toegang!</b><br>" . "Jij bent nog geen Prince mannetje!</div>";
$index->redirect('index.php?page=sjaars');
} else {
if (isset($_POST['submit'])) {
$punten = $_POST[punten] * -1;
//data in DB
$queryAddPunten = "INSERT INTO `sjaarspunt`" . "(`user_id`, `punten`, `date`, `time`, `comment`, `uitdeler_id`) " . "VALUES ('{$_POST['sjaars']}','{$punten}','{$dbDate}', '{$dbTime}','{$_POST['comment']}','{$sessionUserId}')";
$db->insert($queryAddPunten);
echo "<div class='alert alert-success' role='alert'><b>Minpunten toegerekend!</b><br>" . "Jij bent nog geen Prince, mannetje!</div>";
$index->redirect('index.php?page=sjaars');
} else {
$querySelectPuntJulius = "SELECT SUM(punten) as punten FROM sjaarspunt WHERE user_id = '12'";
$querySelectPuntCalvin = "SELECT SUM(punten) as punten FROM sjaarspunt WHERE user_id = '13'";
$selectJuliusResults = $db->select($querySelectPuntJulius);
$selectCalvinResults = $db->select($querySelectPuntCalvin);
foreach ($selectCalvinResults as $calvin) {
$calvinPunten = $calvin[punten];
}
foreach ($selectJuliusResults as $julius) {
$juliusPunten = $julius[punten];
}
示例5: changeMailcheck
function changeMailcheck($newMail1, $newMail2)
{
$index = new Index();
if ($newMail1 == $newMail2) {
$this->updateMail($newMail1);
$index->redirect('index.php?page=account');
} else {
echo "<div class='alert alert-warning' role='alert'>Het nieuwe emailadres komt niet overeen.</div>";
$index->redirect('index.php?page=account&action=changemail');
}
}