Page 1 of 1

creating some kind off symbolic link

Posted: Tue Oct 14, 2003 1:53 pm
by RobbertvanOs
I have a question, i made a script that can be used under several domains. This script detects on what domain it is and get's the data from the database. Now i want to make it easy and i don't want to copy it over and over to each ftp account i create and want to use this script on.
So i want to make some kind off symbolic link to another domain, does someone know how to do this, the files are on the same server, but i want to be safe if my provider switches some domains, that it will still work, The advantage from this theory is that my effort to update this script is easy and all scripts will update automaticly,

Does anyone have good ideas? Hope so:-)

Kind regards Robbert

Posted: Tue Oct 14, 2003 2:00 pm
by Gen-ik
Well you can include files into your PHP from any where.

You could give someone this.....

<?
include("http://mydomain.com/php/functions.php");
?>

....and then just update the functions.php file whenever you need to. That way everyone using the script will get the latest functions.php file.

But a lot of people won't like this because of security reasons. I know if someone gave me a script that included a file from another server I wouldn't use it.

It's one method though.

Posted: Tue Oct 14, 2003 2:03 pm
by volka
you might copy one file that holds all the include code with absolute paths.
Or you really create symbolic links:
http://www.opengroup.org/onlinepubs/007 ... cu/ln.html
http://support.microsoft.com/?kbid=205524

edit:
if the mydomain.com server is set up to handle php scripts this will include only the output of functions.php

Posted: Tue Oct 14, 2003 2:12 pm
by RobbertvanOs
Well i tried this simple trick offcourse :lol: but unfortuanatly it didn't parse the url the script was running on and therefor it didn't work. It should get the script from another script and execute it when it is on the "new" server. This makes it difficult, i tried many things and want to make some kind of symbolic link to another directory on another domain :roll:

Robbert
Gen-ik wrote:Well you can include files into your PHP from any where.

You could give someone this.....

<?
include("http://mydomain.com/php/functions.php");
?>

....and then just update the functions.php file whenever you need to. That way everyone using the script will get the latest functions.php file.

But a lot of people won't like this because of security reasons. I know if someone gave me a script that included a file from another server I wouldn't use it.

It's one method though.