本文整理汇总了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"]);
}
}