RE: [PHP] remotely include file

From: Date: Wed, 09 May 2001 12:02:39 +0000
Subject: RE: [PHP] remotely include file
Groups: php.general 
Request: Send a blank email to php-general+get-52096@lists.php.net to get a copy of this message
there is a way to prevent the remote server from parsing the file before sending it: use an extension that is not associated to php on that server (ie something like .incphp or whatever extension that is not parsed on that server) and add that extension in the "receiving" server's config for instance if y're using apache, y'd add: Action application/x-httpd-php4 "/php4/php.exe" AddType application/x-httpd-php4 .php .incphp this way the sending server would send the file as plain text and your server would include it and parse it i never tried this but it should work the downside with this is that your includes could be easaly downloaded and read by anyone on the host server, but you could restrict access to those files to some hosts..... regards hassan el forkani 09/05/01 13:37:55, Ben Cairns <BenC@intasept.com> wrote: >When PHP does a require or an include on a remote file via http, it sends a >GET request to the http server that the file is on, > >Therefore, if this server has PHP installed on it, then the web server will >parse the file before it spits it out. Thus, all of the PHP tags are stripped >fom the file for output. > >Therefore, you cannot remotely include (via http) a php file. If you could, >this would be a massive security loophole. > > >-- Ben Cairns - Head Of Technical Operations >intasept.COM >Tel: 01332 365333 >Fax: 01332 346010 >E-Mail: BenC@intasept.com >Web: http://www.intasept.com > >"MAKING sense of >the INFORMATION >TECHNOLOGY age >@ WORK......" > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > >

« previous php.general (#52096) next »