Advertisement
Guest User

Untitled

a guest
Nov 13th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. <?php
  2. ob_start(); // output buffering is turned on
  3.  
  4. // Assign file paths to PHP constants
  5. // __FILE__ returns the current path to this file
  6. // dirname() returns the path to the parent directory
  7. //define("PRIVATE_PATH", dirname(__FILE__));
  8.  
  9.  
  10.  
  11. define("PROJECT_PATH", substr(dirname(__FILE__), 0, strlen(dirname(__FILE__)) - 13));
  12. define("HTML_PATH", PROJECT_PATH . '/html');
  13. define("INCLUDE_PATH", PROJECT_PATH . '/html/include');
  14.  
  15.  
  16. // Assign the root URL to a PHP constant
  17. // * Do not need to include the domain
  18. // * Use same document root as webserver
  19. // * Can set a hardcoded value:
  20. // define("WWW_ROOT", '/~kevinskoglund/globe_bank/public');
  21. // define("WWW_ROOT", '');
  22. // * Can dynamically find everything in URL up to "/public"
  23. $public_end = strpos($_SERVER['SCRIPT_NAME'], '/HTML') + 19;
  24. $doc_root = substr($_SERVER['SCRIPT_NAME'], 0, $public_end);
  25. define("WWW_ROOT", $doc_root );
  26.  
  27. define("WWW_CB", WWW_ROOT . '/html/Company_Background');
  28. define("WWW_M", WWW_ROOT . '/html/members');
  29. define("IMAGES_PATH", WWW_ROOT . '/images');
  30. define("CSS_PATH", WWW_ROOT . '/css');
  31. define("SCRIPT_PATH", WWW_ROOT . '/scripts');
  32. define("INCL_PATH", WWW_ROOT. '/html/include');
  33.  
  34. //echo WWW_ROOT;
  35. require_once('functions.php');
  36. require_once('database.php');
  37. session_start();
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement