0

我正在做一个移动优化汽车经销商网站的项目。问题是,我们无法直接访问他们的 MySQL 数据库(他们没有 API)来动态生成页面。

我想要做的是 PHP 包含他们的页面,即使我得到这个错误:

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/content/88/8653188/html/campaigns/summumauto/index.php on line 10

Warning: include(http://www.summumauto.com/en/usedcars/listing/details.spy?id=4745209) [function.include]: failed to open stream: no suitable wrapper could be found in /home/content/88/8653188/html/campaigns/summumauto/index.php on line 10

Warning: include() [function.include]: Failed opening 'http://www.summumauto.com/en/usedcars/listing/details.spy?id=4745209' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/88/8653188/html/campaigns/summumauto/index.php on line 10

然后我想使用我自己的样式表来积极地处理页面的 CSS 以正确地将页面变形为对移动设备友好。

有什么解决方法可以使这成为可能,还是我完全卡住了?

提前致谢 :)

4

2 回答 2

0

您需要将allow-url-include配置选项设置为 true,这样您的上述代码才能正常工作。

于 2012-09-24T16:17:10.087 回答
0

您应该能够使用curl 函数来解决该错误。

另一方面,如果您可以配置您的服务器,则可以允许包含(可能是 file_get_contents 而不是包含)URL,尽管这可能会带来安全漏洞

于 2012-09-24T16:17:39.647 回答