• You are not logged in. | Login

Post a reply

  • Index
  •  » Help me!
  •  » Appealing to a remote file containing library of functions

March 19, 2007 9:20 am

tucansam
Member
Ranks

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?  sad


 

 

March 19, 2007 9:22 am

mambojim
Member
Ranks

Re: Appealing to a remote file containing library of functions

Because it’s absolutely impossible.


 

 

March 19, 2007 9:24 am

tucansam
Member
Ranks

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

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? hh

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
Ranks

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
Ranks

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
Ranks

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  hh

So you are to find another variant…


 

 

March 19, 2007 9:39 am

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.  wink


 

 

March 19, 2007 9:42 am

SRG
Member
Ranks

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  smile


 

 

March 19, 2007 9:44 am

tucansam
Member
Ranks

Re: Appealing to a remote file containing library of functions

I’ve done everything and everything is all right  smile  Thanks  smile


 

 
  • Index
  •  » Help me!
  •  » Appealing to a remote file containing library of functions
  • Actions
  • Top
ITCrimea. Ukraine Web Development Company. Professional Developers and Web Designers Team
Custom Web Designs, Internet Applications, E-Commerce Websites, Interactive Sites, Database-Driven Sites and Services