本文整理匯總了PHP中runner::redirect方法的典型用法代碼示例。如果您正苦於以下問題:PHP runner::redirect方法的具體用法?PHP runner::redirect怎麽用?PHP runner::redirect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類runner
的用法示例。
在下文中一共展示了runner::redirect方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
<?php
/**
* Created by PhpStorm.
* User: csibi
* Date: 2015.02.18.
* Time: 14:55
*/
$post = $_POST;
$msg = "";
if (!logincrypt($post["email"], $post["password"], $msg)) {
echo '<div class="alert alert-danger">' . $msg . '</div>';
} else {
echo '<div class="alert alert-success">Logged in successfully!</div>';
$SQL = "SELECT id, email, last_login, last_ip, licence FROM member WHERE email = :email";
if ($result = \Routerunner\Db::query($SQL, array(":email" => $post["email"]))) {
$user = $result[0];
if (isset($post["rememberme"]) && $post["rememberme"]) {
$user["rememberme"] = true;
}
\runner::flash('member', $user);
$SQL = "UPDATE member SET last_login = :last_login, last_ip = :last_ip WHERE email = :email";
$params = array(":last_login" => time(), ":last_ip" => $_SERVER["REMOTE_ADDR"], ":email" => $post["email"]);
\Routerunner\Db::query($SQL, $params);
\runner::redirect($_SERVER["HTTP_REFERER"]);
}
}