Hi
I have a local network server, and four sites with the same script on. How I handle it is:
- Create a config file, such as myconfig.inc.php
(This file you will need to locate accurately in each php file, so some editing is required).
In that file do something like this:
if ($_SERVER['DOCUMENT_ROOT']=="D:/Apache2/htdocs/My_Website")
{
//URL path for php files (NOT includes)
$docRoot="D:/Apache2/htdocs/My_Website";
//root to css, images, html and java
$root_url="D:/Apache2/htdocs/My_Website";
//roots to php files
$root_alturl="http://localhost:8080";
}
elseif ($_SERVER['DOCUMENT_ROOT']=="/home/server1user/public_html")
{
//URL path for php files (NOT includes)
$docRoot="/home/server1user/public_html";
//root to css, images, html and java
$root_url="http://www.yourweb.com";
//roots to php files
$root_alturl="http://www.yourweb.com";
}
Then use the variables as indicated. The $docRoot is used for URL references to links for php files, as external links often cause security issues (many server owners have banned the use of [url]http://www.*****.com[/url] links to php files when included or required, etc).
Trevor