Server-Side-like Paths

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
AliasBDI
Forum Contributor
Posts: 286
Joined: Fri Nov 15, 2002 10:35 am
Location: Spring, TX, USA

Server-Side-like Paths

Post by AliasBDI »

Hello all. I am doing something that is quite hard for my little pee brain to explain. I have two domains (on a virtual shared server) granted permissions to share files (one way). DomainA has the system files and DomainB requests those files. Actually, DomainB is requesting a PHP file which builds the site.

I am doing it this way so that many domains could run off of the same files (from one system space) which makes updates easier. Everything that is PHP is rendering fine. However, when the PHP echo's HTML code that has paths, the paths are wrong. So, absolute and relative paths both look within DomainB for the files. But the files are in DomainA. Does this make sense? If so, any ideas on how I can tell it to look in DomainA without putting a full relative path (I don't want users to be able to see that path).
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Server-Side-like Paths

Post by alex.barylski »

I do somethign very similar.

On each domain you will need at least a single index.php as an access point. Inside the index.php you will specifiy the directory via chdir(). This sets the base path for everything else
AliasBDI
Forum Contributor
Posts: 286
Joined: Fri Nov 15, 2002 10:35 am
Location: Spring, TX, USA

Re: Server-Side-like Paths

Post by AliasBDI »

PCSpectra wrote:I do somethign very similar.

On each domain you will need at least a single index.php as an access point. Inside the index.php you will specifiy the directory via chdir(). This sets the base path for everything else
Could you give me an example of how it would work?
AliasBDI
Forum Contributor
Posts: 286
Joined: Fri Nov 15, 2002 10:35 am
Location: Spring, TX, USA

Re: Server-Side-like Paths

Post by AliasBDI »

Thinking about the chdir() ... the problem with this is that it will show the path in the HTML code and I don't want the user to know where the files exist.
Post Reply