=============================================================
Using include $_SERVER["DOCUMENT_ROOT"]
======================================================
=======
Note: The Library Web Server administrators have requested that we change our PHP includes links (especially for the Banner (Header) and Navigation Bar (NavBar) to relative ones as an effort to prevent web server crashes. In order to do that, this is the plan outline. --mp
-------------------------------------------------------------
1 Basic element
-------------------------------------------------------------
1.1 include($_SERVER["DOCUMENT_ROOT"] . '/xxx/xyxyxy.php');
-------------------------------------------------------------
2 From one folder down
(This works.)
-------------------------------------------------------------
2.1 Example: https://library.austincc.edu/eresources/testing.php
2.2 Page element:
<div id="hang">
<?php include($_SERVER["DOCUMENT_ROOT"] . '/hang.html'); ?>
</div><!-- end of hang -->
-------------------------------------------------------------
3 From one folder down
(This works.)
-------------------------------------------------------------
3.1 Adding the header to the same file "testing.php"
3.2 Page element:
<!-- This next section contains a header file in the includes folder. -->
<?php include($_SERVER["DOCUMENT_ROOT"] . '/includes/header.php'); ?>
-------------------------------------------------------------
4 From two folders down
(This works.)
-------------------------------------------------------------
4.1 TestA:
https://library.austincc.edu/eresources/testA/testA.php
4.1.1 Previous includes with doc_root still works.
4.2 TestB with HeaderNavZ:
https://library.austincc.edu/eresources/testA/testB.php
4.2.1 Previous includes with doc_root still works.
4.2.2 Page elements (HeaderNavZ.php):
<?php include("header.php"); ?>
<?php include("navbar.php"); ?>
-------------------------------------------------------------
5 Next Step
-------------------------------------------------------------
5.1 At the end "HeaderNavZ.php" = "HeaderNav.php"
(or maybe not necessary to rename)
5.2 Replace
5.2.1
<?php include("https://library.austincc.edu/includes/TopScripts.txt"); ?>
5.2.1.1 With
✔done
<?php include($_SERVER["DOCUMENT_ROOT"] . '/includes/TopScripts.txt'); ?>
5.2.2
<?php include("https://library.austincc.edu/includes/HeaderNav.php"); ?>
5.2.2.1 With
✔done
<?php include($_SERVER["DOCUMENT_ROOT"] . '/includes/HeaderNavZ.php'); ?>
5.2.3
<?php include("https://library.austincc.edu/includes/footer-LSphp"); ?>
5.2.3.1 With
✔done
<?php include($_SERVER["DOCUMENT_ROOT"] . '/includes/footer-LS.php'); ?>
5.2.4
<?php include("https://library.austincc.edu/includes/ReadThumbs.php"); ?>
5.2.4.1 With
✔done
<?php include($_SERVER["DOCUMENT_ROOT"] . '/includes/ReadThumbs.php'); ?>
-------------------------------------------------------------
6 Next Step for the php files in the Root folder
✔done
------------------------------------------------------------- 11/25/17
6.1 No need for the DocRoot script in the Root folder
6.2 Replace
6.2.1
https://library.austincc.edu/includes/
6.2.1.1 With
includes/
6.2.2 So
<?php include("https://library.austincc.edu/includes/xcxcx.php"); ?>
Becomes
<?php include("includes/xcxcx.php"); ?>