RE: [PHP] Remote include
| From: | James Harrell | Date: | Wed, 09 Jun 2004 13:40:02 +0000 |
| Subject: | RE: [PHP] Remote include | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-187948@lists.php.net to get a copy of this message | ||
Greetings Tumurbaatar,
That would work- and you shouldn't need any special mime types;
URL_fopen must be on and you simply use include() to get the remote
file read into the current one and executed.
But I highly suggest you find an alternative method- since this can
expose you to several security issues. The biggest of which is that
if someone can convince your application to include their file instead
of yours... you've supplied a remote code execution hack onto the
machine. Very dangerous.
James
>-----Original Message-----
>From: Tumurbaatar S. [mailto:tumurbaatar@datacom.mn]
>Sent: Wednesday, June 09, 2004 5:31 AM
>To: php-general@lists.php.net
>Subject: [PHP] Remote include
>
>
>I need to include in my PHP code a script located at a remote
>web server. The script is also PHP and contains some functions and
>class definitions. Because the remote server also use PHP, I've
>changed my include file extension ("php") to something other (e.g. "inc").
>Because I'm afraid that the server will execute the script (which
>produces nothing) instead of sending its content. Am I doing right?
>Also, when the remote server sends this file back to my local server,
>what MIME type is returned in the response header? Anybody know it?
>Do I need to specify some type?
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>