怎么设置登录成功后跳转到相应的页面

如题所述

ECShop设置用户登陆后自己跳转外网页面需要修改index.php和user.php文件。
在这里演示:
用户登录后页面会跳转到一个信息提示页面,登录成功不做任何操作则会在几秒后自动跳转到指定目标页面,接下来看操作:

1、我们打开index.php文件
找到 require(dirname(__FILE__) . '/includes/init.php'); 的下面加上一条判断,
if($_SESSION['user_id']<1){Header("Location: user.php");}
首页就可以实现如果没登录先登录,否则注册。

2、然后打开user.php,修改第300行
show_message($_LANG['login_success'] . $ucdata , array($_LANG['back_up_page'], $_LANG['profile_lnk']), array($back_act,'user.php'), 'info');
为 show_message($_LANG['login_success'] . $ucdata , array('返回网站首页', $_LANG['profile_lnk']), array('index.php','user.php'), 'info');

3、完成后分别保存index.php、user.php,上传到原来的目录就可以了。
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答