English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a multiple-client hosting solution and I was wondering if I could access a single php file with my various client sites.

I have root access to my server. It is a linux box.

Also, will these files be secure? I presume so, I just need reassurance. ;)

2007-01-08 04:26:28 · 1 answers · asked by oijhoa 1 in Computers & Internet Programming & Design

1 answers

save the common file to a neutral location and include the file using:
include 'filename.php';

dots and slashes will be key to making this work, to step back through the directories.
example... picture the following directory setup:
root\client1\pages\index.php
root\client2\pages\index.php

if you put the include file in the \pages directory, it can be shared with all sub directories (depending on your web server, you may need to play with the proceeding dots) :
include '.\filename.php';

2007-01-08 04:59:03 · answer #1 · answered by spl 4 · 0 0

fedest.com, questions and answers