Page 1 of 1

How Do I: Combine a URL path variable in an include?

Posted: Wed Aug 20, 2008 3:35 am
by JetJagger
PHP 4.0

Allow me to explain.

Wherein I have simple includes like:

Code: Select all

<?php include('[color=#BF0000]http://whatever.mywebsite.com/[/color][color=#000080]bodyCopy/path-to-page.php[/color]') ?>
I want to be able to change the http path (in red above) to any path while keeping the file path (in blue above) intact. The way I would like to control this is using one 'master http control file' where I can simply change the http path and have that single change cascade to all includes.

To do this, I THINK (though I'm not sure), that the http path (in red above) will need to point to the 'master http control file'. I assume (though I'm not sure) that the 'master http control file' can be a txt file since its only function is to complete the http path within the include.

My question is this: What is the proper way to write the code inside of the include (to replace the text in red above) so that it pulls in the http path from my 'master http control file' and seamlessly adds it to the file path (in blue above) to appear as a single, linear http path to the browser?

(Don't forget that the actual file paths are going to be different in each include.)

Thanks for the help.

Best,

Jet

Re: How Do I: Combine a URL path variable in an include?

Posted: Wed Aug 20, 2008 10:55 am
by JetJagger
bump

Re: How Do I: Combine a URL path variable in an include?

Posted: Wed Aug 20, 2008 1:02 pm
by Christopher

Code: Select all

<?php include('/path/to/my/public/html/directory/bodyCopy/path-to-page.php') ?>