
- You are not logged in. | Login
March 19, 2007 9:20 am
- tucansam
- Member


Appealing to a remote file containing library of functions
I have a question.
Here is a site www.site1.com
And there is file index.php in it.
In this index.php function firm() is called which handling is in file fnc.php on another server (site).
In index.php on site www.site1.com there is a string:
require_once("http://www.site2.com/dl/fnc.php");
When starting www.site1.com I’m displayed:
Fatal error: Call to undefined function: firm() in /www/****/www/htdocs/1/index.php on line 11
Why doesn’t it involve remote PHP? 
March 19, 2007 9:22 am
- mambojim
- Member


Re: Appealing to a remote file containing library of functions
Because it’s absolutely impossible.
March 19, 2007 9:24 am
- tucansam
- Member


Re: Appealing to a remote file containing library of functions
What do you mean? Is it impossible to upload file with functions?
March 19, 2007 9:26 am
- PilgrimFarAway
- Member


Re: Appealing to a remote file containing library of functions
Imagine that there is file config.php containing passwords’ list on some bank’s site – can you link up this file remotely from your script and get the passwords’ list? 
When using require for URLs you get the query result http://www.site2.com/dl/fnc.php instead of the file’s source.
I.e. you are to enter http://www.site2.com/dl/fnc.php in the browser and look up what is displayed there – this is the same text which your index.php is going to get.
March 19, 2007 9:29 am
- tucansam
- Member


Re: Appealing to a remote file containing library of functions
But how to link up libraries remotely?
March 19, 2007 9:31 am
- shadow122
- Member


Re: Appealing to a remote file containing library of functions
You may find out different sophisticated variants but you are to know for sure if you really need this. It’s most likely that you don’t need any remote libraries at all.
March 19, 2007 9:34 am
- sirburpsalot
- Member


Re: Appealing to a remote file containing library of functions
Usually libraries from the same server are linked up.
Linking up libraries from other server via HTTP demands a lot of resources and is rather stupid
So you are to find another variant…
March 19, 2007 9:39 am
- selmahyekishot
- Member


Re: Appealing to a remote file containing library of functions
I’ve got a stupid idea… Let fnc.php display content of the ‘old’ fnc.php and everything is going to be all right. 
March 19, 2007 9:42 am
- SRG
- Member


Re: Appealing to a remote file containing library of functions
You can also attach PHP to site2.com. But the person whose library works with local functionality system is going to have a lot of trouble 
March 19, 2007 9:44 am
- tucansam
- Member


Re: Appealing to a remote file containing library of functions
I’ve done everything and everything is all right
Thanks 


