Reply to Re: Including a .php file from another server?

Your name:

Reply:


Posted by Gordon Burditt on 09/25/05 05:22

>I am trying to include a function in a .php file on a different server from
>the main .php files.

When you fetch a PHP file from a remote server, that server processes it
and sends out the OUTPUT (not the PHP code) from the file. I don't
know how Apache on the server you are trying to fetch from deals
with .inc files as opposed to .php files.

Here's an idea: why don't you COPY phpfiletocall.inc to the local
server and use it there?

>include_path=http://www.anotherserver.com/foldername;
>include(http://www.anotherserver.com/foldername/phpfiletocall.inc);
>
>The .inc file is php formatted. Variables are passed to it (not via GET or
>POST though) and returned using return(variablenames, etc);

If you were expecting to *RUN* phpfiletocall.inc on www.anotherserver.com,
how do you pass variables to it by other than via $_GET or $_POST?

>But for some reason it doesn't appear to work properly.
>
>Am I correct in using the .inc extension?
>Are the commands above correctly written?
>
>Basically I am trying to use the fsockopen function in a .php file on
>another server where I know it works and return the results to a server
>where the fsockopen command doesn't work.

If you are using 'include', you are fetching code from a server
where fsockopen will work (but you're not running it there) and
attempting to use it on a server where it won't work (but that's
where you're trying to make it work), if I understand your problem
correctly.

Gordon L. Burditt

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация