» Smart Phones, Web Design, Google or whatever
PHP: Find Server and Domain Paths
For building sites that can more easily be moved from one server to another, and allows simpler updating of common information like email address and phone number of the client.
Here’s some PHP to generate paths: both server paths and domain paths good for use in all sorts of ways for include and require statements.
<?
// for INCLUDE statements – this is the local server path
$urlPATH = “http://” . $_SERVER['SERVER_NAME'];
$srvPATH = $_SERVER['DOCUMENT_ROOT'];
include ($srvPATH.”/config-settings.php”);
?>
More later.
| Print article | This entry was posted by admin on April 27, 2010 at 2:59 pm, and is filed under Web Design. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |