本文整理汇总了PHP中Framework::redir方法的典型用法代码示例。如果您正苦于以下问题:PHP Framework::redir方法的具体用法?PHP Framework::redir怎么用?PHP Framework::redir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Framework
的用法示例。
在下文中一共展示了Framework::redir方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
parent::init();
// only works if you are in casino
$ct = R::getCell('SELECT map FROM map_position WHERE user_id = ?', array($this->user->getID()));
if ($ct != "casino") {
Framework::redir("game/index");
exit;
}
}
示例2: show_Main
public function show_Main()
{
$error = "";
if ($this->get(1) == 'ok') {
Framework::TPL()->assign('ok', true);
}
if (isset($_POST["change"])) {
$auto = isset($_POST["automatic"]) && $_POST["automatic"] == 1 ? 1 : 0;
$this->myPremium->auto = $auto;
R::store($this->myPremium);
Framework::redir('game/premium/main');
}
if (isset($_POST["activate"])) {
if ($_SESSION['secHash'] != $_POST['hash']) {
Framework::TPL()->assign('pError', 'invalid hash');
return;
}
$length = array(1 => array(3, 150), 2 => array(7, 300), 3 => array(14, 400), 4 => array(30, 500));
$l = @$_POST['length'];
if (!isset($length[$l])) {
Framework::TPL()->assign('pError', 'invalid length');
return;
}
$details = $length[$l];
if ($details[1] > $this->myPremium->points) {
$error = "Du hast nicht genügend Premium-Punkte.";
} else {
$this->myPremium->points -= $details[1];
if ($this->myPremium->until < time()) {
$this->myPremium->until = time() + $details[0] * 24 * 3600;
} else {
$this->myPremium->until += $details[0] * 24 * 3600;
}
R::store($this->myPremium);
$_SESSION['secHash'] = md5(mt_rand(1000, 10000) . microtime(true));
RCached::clear();
// clear cache files
Framework::redir('game/premium/main/ok');
}
}
Framework::TPL()->assign('pError', $error);
}