Last active
December 30, 2015 21:50
-
-
Save NoMan2000/7889852 to your computer and use it in GitHub Desktop.
Set document root folders.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] ); ?> | |
<?php /* Another way of handling the same problem */ | |
$path = $_SERVER['DOCUMENT_ROOT']; | |
$path .= "/common/header.php"; | |
include_once($path); | |
dirname(__FILE__); | |
?> | |
<?php echo "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; | |
function url(){ | |
return sprintf( | |
"%s://%s%s", | |
isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http', | |
$_SERVER['HTTP_HOST'], | |
$_SERVER['REQUEST_URI'] | |
); | |
} | |
echo url(); | |
?> | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment