我们希望访问ECSHOP网站首页的时候,要求必须登录,登录成功后才能正常显示首页。
第一步:
打开index.php文件
查找:
| 1 | require(dirname(__FILE__) . '/includes/init.php'); |
在下面添加一行:
| 1 | if($_SESSION['user_id']<1){Header("Location: user.php");} |
第二步:
打开 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');
大功告成@!
