creating some kind off symbolic link

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
RobbertvanOs
Forum Newbie
Posts: 9
Joined: Wed Jul 02, 2003 2:43 pm

creating some kind off symbolic link

Post 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
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post 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.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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
RobbertvanOs
Forum Newbie
Posts: 9
Joined: Wed Jul 02, 2003 2:43 pm

Post 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.
Post Reply