Php configuration file setting Sample code

Source: Internet
Author: User
Php configuration file setting Sample code

  1. // Each page defines the constants allowed to access the file
  2. Define ('is _ access', true );
  3. /**
  4. **************************************** ********
  5. * **************** 1. basic configuration
  6. **************************************** ********
  7. */
  8. // Exit the program if IS_ACCESS is not defined
  9. If (! Defined ('is _ access') exit ();
  10. // Allow cross-origin 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 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. // Set the header to UTF-8
  17. Header ('content-Type: text/html; charset = UTF-8 ');
  18. // All error levels are displayed in the report.
  19. Error_reporting (E_ALL );
  20. // Do not try to get the sessionid (PHPSESSID? ???? ??? ??)
  21. Ini_set ('session. use_trans_sid ', 0 );
  22. // Disable PHPSESSID (??? PHPSESSID? ??????? ????)
  23. Ini_set ("url_rewriter.tags ","");
  24. /**
  25. **************************************** ********
  26. * **************** 2. environment configuration
  27. **************************************** ********
  28. */
  29. // Define the path
  30. Define ('_ SOLUTION_PATH __','');
  31. Define ('', $ _ SERVER ['document _ root']. _ SOLUTION_PATH __.'/');
  32. Define ('_ HOME _', _ SOLUTION_PATH __.'/');
  33. Define ('_ INCLUDE _',. '_ Include /');
  34. Define ('_ ADMIN _', _ HOME _. 'admin /');
  35. Define ('_ DOMAIN _', $ _ SERVER ['server _ name']);
  36. // Import classes and library files
  37. Require_once (_ INCLUDE _. 'class/class. mysql. php ');
  38. // Set the table
  39. Define ('member', 'member ');

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.