0

What's the best way to include a remote absolute url that contains PHP functions only provided that the relevant variables are configured in the following ways on PHP server?

allow_url_fopen = off
allow_url_include = off

In general, we include relative url like,

<?php include('./directory/file.php'); ?>

and absolute url remotely like,

<?php include('http://site.com/directory/file.php'); ?>
Klanto Aguntuk
  • 719
  • 1
  • 17
  • 44
  • 2
    the example is a local file. Can you clarify if you are really after remote file inclusion (which is a well known attack vector btw) – Gordon Jul 05 '13 at 09:15
  • Is `curl` allowed? You could download the file and then `eval()` it. – Barmar Jul 05 '13 at 09:16
  • @Gordon, yes that's the example of a local file and that's what i said. if you read my question carefully you may see that i mention `relative url` , which obviously means a local file. you should take your time before you make a comment. – Klanto Aguntuk Jul 05 '13 at 09:25
  • @SilentPond my point actually was that the example seems irrelevant to your question. That's why I asked you to clarify what you really are after. – Gordon Jul 05 '13 at 09:32
  • @Gordon i've edited my question although my example wasn't irrelevant to my question at all. i just simply gave an `include` example as the question is basically about `include` function. – Klanto Aguntuk Jul 05 '13 at 10:42
  • remote url can be included correctly as `` provided that `allow_url_fopen = on` & `allow_url_include = on`. manual: http://php.net/manual/en/features.remote-files.php – Klanto Aguntuk Jul 05 '13 at 10:50
  • thanks for the clarifications. However, the answers to your question are given in the linked dupe and in the answers that the linked dupe is a dupe of. If those do not answer your question, ask a new question pointing out why these didn't help and what you are after. – Gordon Jul 05 '13 at 11:15
  • @Gordon i went through some 20 similar posts in `stackoverflow.com` related to my question but actually either the questions or the answers don't state what exactly i asked in my question. however, thanks for your reference. – Klanto Aguntuk Jul 05 '13 at 18:09
  • you are welcome. For future questions, make sure you've been through the [Stack Overflow question checklist](http://meta.stackexchange.com/questions/156810/stack-overflow-question-checklist) and maybe revisit http://stackoverflow.com/questions/ask-advice for additional pointers on how to prevent your questions from getting put on-hold or downvoted. – Gordon Jul 05 '13 at 18:21

0 Answers0