Phpcms a simple way to modify the background path

Source: Internet
Author: User
Before on the internet to find a lot of changes to modify the phpcms background path, but all too cumbersome (personal feeling), finally found a relatively simple method of modification, here and everyone to share, hope to learn from each other.

The first step:
Create a folder at the root of the Web site, will be through this folder to enter the background login interface, so the folder name is not easy to guess the name of a person easily guessed. Here as a demonstration, I'll take it as a adminweb. Next, create a new file index.php in this folder, with the following contents:

 
  Realpath (dirname(__file__). '/..') . '/'); include // Pc_base::creat_app (); $session _storage = ' session_ '. Pc_base:: Load_config (' System ', ' Session_storage ':: Load_sys_class ($session _storage); Session_Start (); $_session [' right_enter '] = 1; unset ($session _storage); Header (' Location:. /index.php?m=admin ');

Step Two:
Create a new file my_index.php in the Phpcms/modules/admin/folder with the following contents:

 
  Exit (' No permission resources. ') ); class extends Index {publicfunction  __construct () {if (empty(  $_session[' Right_enter ']) {header(' location:./'); Exit  :: __construct ();}  Public function public_logout () {$_session[' right_enter '] = 0:: public_logout ();}}

This modification, only need two places to be able, do not divide so many steps, and the site backstage only through/adminweb, so it is not easy to find your backstage entrance, here need to note is, if you use/adminweb login, you press the original/admin.php

The above describes the Phpcms to modify the background path of the simple method, including the aspects of the content, I hope the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.