按继续购买重定向到结帐页面

时间:2017-05-04 12:41:03

标签: php url-rewriting checkout

我如何在我的登录页面中应用条件,以便用户点击继续结帐按钮并进入登录页面,一旦他登录,所以他不进入主页,但他进入结帐页面。

我已经尝试了查询字符串方法,其中我在登录URL之后添加了checkout字符串,如此login.php/checkout所以我很容易得到该字符串并与我的字符串比较如“checkout”如果为true则checkout.php else home.php。

但这也行不通。

我的代码:

if(strlen($_SESSION['login'])==0) {
    header('location:login.php?page=checkout');
}

if($_GET['page']=="checkout") {
    header('location:checkout.php');
}

0 个答案:

没有答案