Home >Backend Development >PHP Tutorial >Methods to prevent direct access, viewing or downloading of the config.php file

Methods to prevent direct access, viewing or downloading of the config.php file

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-25 09:04:411294browse
  1. define('IN_SYS', TRUE);
Copy code

2 Get this variable in config.php

  1. if(!defined('IN_SYS')) {
  2. exit('Access Forbidden');
  3. }
Copy the code

In this way, undefined free viewing or downloading is achieved .



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn