Home  >  Article  >  Backend Development  >  PHP configuration file setting example code

PHP configuration file setting example code

WBOY
WBOYOriginal
2016-07-25 08:54:191167browse
  1. // Each page definition allows access to file constants
  2. define('IS_ACCESS', true);
  3. /**
  4. ************************************************
  5. **************** 1.Basic configuration
  6. ***************************** *********************
  7. */
  8. // If IS_ACCESS is not defined, then Exit the program
  9. if (!defined('IS_ACCESS')) exit();
  10. // Allow cross-domain access to private data
  11. header ('P3P: CP="NOI CURa ADMa DEVa TAIa OUR DELa BUS IND PHY ONL UNI COM NAV INT DEM PRE"');
  12. // Disable caching of the current document
  13. header ("Cache-Control: no-store, no-cache, must-revalidate");
  14. header ("Cache-Control: post-check=0 , pre-check=0", false);
  15. header ("Pragma: no-cache");
  16. // The header information is set to utf-8
  17. header ('Content-Type: text/html; charset=UTF- 8');
  18. // Reporting shows all error level types
  19. error_reporting (E_ALL);
  20. // Do not try to get sessionid from elsewhere (PHPSESSID? ???? ??? ??)
  21. ini_set('session. use_trans_sid', 0);
  22. // Forbidden to include PHPSESSID in the link (??? PHPSESSID? ??????? ????)
  23. ini_set ("url_rewriter.tags","");
  24. /**
  25. ************************************************
  26. **************** 2. Environment configuration
  27. ***************************** *********************
  28. */
  29. // Define path
  30. define('__SOLUTION_PATH__', '');
  31. define('__ROOT__', $_SERVER['DOCUMENT_ROOT'] . __SOLUTION_PATH__ .'/');
  32. define('__HOME__ ', __SOLUTION_PATH__ .'/');
  33. define('__INCLUDE__', __ROOT__ .'_Include/');
  34. define('__ADMIN__', __HOME__ .'Admin/');
  35. define('__DOMAIN__', $_SERVER[' SERVER_NAME']);
  36. // Import class and library files
  37. require_once(__INCLUDE__ .'class/class.mysql.php');
  38. // Set up table
  39. define('MEMBER', 'member');
Copy code


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