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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JetJagger
Forum Newbie
Posts: 6
Joined: Sun Jan 20, 2008 11:35 am

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

Post 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
JetJagger
Forum Newbie
Posts: 6
Joined: Sun Jan 20, 2008 11:35 am

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

Post by JetJagger »

bump
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

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

Post by Christopher »

Code: Select all

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