How to modify the phpcms background path:
Method 1: Change it to a second-level domain name in the management background.
Method 2: Determine the management entrance based on the custom SESSION value.
This method requires modifying the default phpcms php file, customizing a portal to start SESSION, and then judging the SESSION. If it matches, log in, if not, jump to the home page. CMSYOU currently uses this method. 1. Modify the \phpcms\modules\admin\index.php file and add at the beginning of the public function __construct() method://login diy if (empty($_SESSION['cms_login'])) { header('location:'.APP_PATH); exit; }
$_SESSION['cms_login'] = 0;
<?php define('PHPCMS_PATH', realpath(dirname(__FILE__) . '/..') . '/'); include PHPCMS_PATH . '/phpcms/base.php'; // pc_base::creat_app(); $session_storage = 'session_' . pc_base :: load_config('system', 'session_storage'); pc_base :: load_sys_class($session_storage); session_start(); $_SESSION['cms_login'] = 1; unset($session_storage); header('location:../index.php?m=admin'); ?>
PHPCMS tutorials, welcome to learn online!
The above is the detailed content of How to change the phpcms background path. For more information, please follow other related articles on the PHP Chinese website!