Home >Backend Development >PHP Tutorial >PHP protects internal files from being accessed

PHP protects internal files from being accessed

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-29 09:06:121175browse

If it is a php file loaded by internal require and is not displayed in the URL, how can it be better protected?

First write

<code><span><span>define</span></span>(<span>'IN_SYS'</span>, <span>true</span>);</code>

in the entry file and then write a sentence at the beginning of other internal files

<code><span>if</span>(!<span>defined</span>(<span>'IN_SYS'</span>)) <span>die</span>(<span>'Access Denied!'</span>);</code>
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces PHP to protect internal files from being accessed, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.

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
Previous article:php time conceptNext article:php time concept