RE: [PHP-WIN] Include()
| From: | alain samoun | Date: | Tue, 22 Jan 2002 02:52:05 +0000 |
| Subject: | RE: [PHP-WIN] Include() | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-11549@lists.php.net to get a copy of this message | ||
Humm, I do not know if I understand you...
If you include a file in your server A, it will run in your server locally
as part of your code. Now if the included file is located at another server
B, it should be all the same, the included file will run as part of your
code in server A, isn't it?
A+
Alain
-----Original Message-----
From: Shrock, Court [mailto:ShrockC@inhs.org]
Sent: Monday, January 21, 2002 4:38 PM
To: php-windows@lists.php.net
Subject: RE: [PHP-WIN] Include()
Yes, it works on Linux/Apache. But the results are not what you might
expect. When one normally uses the include statement, you intend to process
some php file, not the output from such a file.
For example:
nfo.php contains, located at http://www.myserver.com/nfo.php :
------BEGIN FILE---------
<?php
function nfo($addr) {
return getnamebyaddr($addr);
}
echo nfo($REMOTE_ADDR);
?>
-------END FILE-----------
test.php contains, located at http://www.otherserver.com/test.php :
------BEGIN FILE---------
<?php
include('http://www.myserver.com/nfo.php');
echo nfo($REMOTE_ADDR);
?>
-------END FILE-----------
When you visit http://www.otherserver.com/test.php, the nfo
function is not
defined, but results are returned by the include because the server connects
to http://www.myserver.com and correctly includes the results
(output) from
that visit. It is essentially an alternative to
fopen('http://www.myserver.com/nfo.php') if you just
want to echo all the
results of the fopen.
-----Original Message-----
You are right, it doesn't seem to work with windows, I don't know if it
works with *nix either?
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
For additional commands, e-mail: php-windows-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net