Home >Backend Development >PHP Tutorial >PHP multi-user message system (the third project) (1)

PHP multi-user message system (the third project) (1)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-08-08 09:28:381005browse

1. Set comment template

Many projects will add the following annotation file, author name, time, and other information to the header of each code file

/**

* TestGuest Version1.0

* ================================================

* Copy 2014-2015 yc60

* Web: http://www.yc60.com

* ================================================

* Author: Lee

* Date: ${date}

*/

Add the above annotation information to the new file specified in the Templates template.

Call ico file

Two. Separate the head and tail

Separate the header and trailer HTML and define them as header.inc.php and footer.inc.php respectively. Do this

The advantage of

is that it reduces the amount of code and the amount of repeated work. The code structure is as follows

Under the include folder, the code structure is as follows

Three. Prevent malicious calls (prevent other people’s websites from directly calling our headers and trailers and other files.)

In order to prevent malicious calls to the inc.php module file from external websites, you can add the following statement. In every inc.php

//Prevent malicious calls

if (!defined('IN_TG')) {

exit('Access Defined!');

}

4. To be continued

The above introduces the PHP multi-user message system (the third project) (1), 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