Steve R.
Retired
- Local time
- Today, 15:47
- Joined
- Jul 5, 2006
- Messages
- 5,615
I am modifying the code to some of my (home LAN) web-pages in the hopes of streamlining and reducing unnecessary code. I am wonder what the industry standard practice is for locating code that will be used by subsequent web-pages. (Note: this project operates solely on a home LAN)
Below are the first few lines of the "homepage" (index.php). I just moved the line "require_once 'php_functions/functions.php';" into this block of code. So far, no errors have been experienced. So it is looking "good". Would it be appropriate to continue moving PHP code into this block?
Below are the first few lines of the "homepage" (index.php). I just moved the line "require_once 'php_functions/functions.php';" into this block of code. So far, no errors have been experienced. So it is looking "good". Would it be appropriate to continue moving PHP code into this block?
Code:
<?php
// Start the session
session_start();
// Get current Working Directory
$_SESSION['cwd'] = getcwd();
// This may work for all subsequent pages. Need to verify.
require_once 'php_functions/functions.php';
?>