[英]how to to include a file from main domain to subdomain
want to include a file from main domain to subdomain想要包含从主域到子域的文件
index.php - on subdomain.example.com
index.php - 在
subdomain.example.com
ini_set("allow_url_fopen", 1);
ini_set("allow_url_include", 1);
$host = $_SERVER['HTTP_HOST'];
if($host == 'localhost'){include("../navt.php");}
else{include("https://example.com/navt.php");}
on localhost - there is no problem (win 10, xampp, chrome)在本地主机上 - 没有问题(win 10,xampp,chrome)
on remote server - I'm still getting this:在远程服务器上 - 我仍然得到这个:
include(): https:// wrapper is disabled in the server configuration by allow_url_include=0
The documentation for the allow_url_include
setting includes two important details: allow_url_include
设置的文档包括两个重要的细节:
Both of these are for the same reason: this setting is extremely dangerous .这两者都是出于同样的原因:这个设置非常危险。 It's highly advisable to come up with an alternative solution to your problem, by thinking about how you deploy your code .
通过考虑如何部署代码来为您的问题提出替代解决方案是非常可取的。 For instance:
例如:
include
.include
引用这些文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.