Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-07-09 20:24:56

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,634
GitHub Twitter

External PHP file include into a plugin?

Is it possible to include a php file stored on another server into a plugin code?

How to achieve that?

Tks for your anwer.

Regards,


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#2 2009-07-10 08:49:06

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: External PHP file include into a plugin?

Yes, but it’s not recommended. You never know what script do you include.

<?php
  include 'http://example.com/script.php';
?>

This does only work when in php.ini the allow_url_fopen is true.

Edit: But for clearifying. This is not a »real« include. You don’t have the scope of the script on your server. You can f.i. pass variables via GET, the script will be run on the remote server and the result is that what you can include.

Last edited by trenc (2009-07-10 09:05:50)


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#3 2009-07-10 16:18:20

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,634
GitHub Twitter

Re: External PHP file include into a plugin?

Tks Trenc for your reply.

Regards,


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

Board footer

Powered by FluxBB