PHP configuration file setting example code
Release: 2016-07-25 08:54:19
Original
1309 people have browsed it
-
-
- // Each page definition allows access to file constants
- define('IS_ACCESS', true);
-
- /**
- ************************************************
- **************** 1.Basic configuration
- ***************************** *********************
- */
-
- // If IS_ACCESS is not defined, then Exit the program
- if (!defined('IS_ACCESS')) exit();
-
- // Allow cross-domain access to private data
- header ('P3P: CP="NOI CURa ADMa DEVa TAIa OUR DELa BUS IND PHY ONL UNI COM NAV INT DEM PRE"');
-
- // Disable caching of the current document
- header ("Cache-Control: no-store, no-cache, must-revalidate");
- header ("Cache-Control: post-check=0 , pre-check=0", false);
- header ("Pragma: no-cache");
-
- // The header information is set to utf-8
- header ('Content-Type: text/html; charset=UTF- 8');
-
- // Reporting shows all error level types
- error_reporting (E_ALL);
-
- // Do not try to get sessionid from elsewhere (PHPSESSID? ???? ??? ??)
- ini_set('session. use_trans_sid', 0);
-
- // Forbidden to include PHPSESSID in the link (??? PHPSESSID? ??????? ????)
- ini_set ("url_rewriter.tags","");
-
- /**
- ************************************************
- **************** 2. Environment configuration
- ***************************** *********************
- */
-
- // Define path
- define('__SOLUTION_PATH__', '');
- define('__ROOT__', $_SERVER['DOCUMENT_ROOT'] . __SOLUTION_PATH__ .'/');
-
- define('__HOME__ ', __SOLUTION_PATH__ .'/');
- define('__INCLUDE__', __ROOT__ .'_Include/');
- define('__ADMIN__', __HOME__ .'Admin/');
- define('__DOMAIN__', $_SERVER[' SERVER_NAME']);
-
- // Import class and library files
- require_once(__INCLUDE__ .'class/class.mysql.php');
-
- // Set up table
- define('MEMBER', 'member');
Copy code
|
Statement of this Website
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
Latest Articles by Author
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31