包括一个网站的php文件 [英] include a website in php file

查看:87
本文介绍了包括一个网站的php文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我想将其他网站的网页连结纳入我的网站。
我如何做到这一点?



我试过



?php web_include('http://website.com/website.html'); ?>
,但所有命令在此语句之后不加载。我想直接将另一个网页加入我的首页。我的主页是完全设计在php,但另一个是html或php。



我也尝试了<?php include //www.othersite.com/filename.html);

可能的解决方案:
ok这个html不能加载。



<是我使用的



< iframe name =FRAMENAMEsrc =http://website.com/dropdown.htmlwidth =1000style =z-index:10000height =40frameborder =0scrolling =noallowautotransparency = true>< / iframe>
$ b

我只是为我的索引页添加了一个下拉菜单。我的网站的CMS限制我查看在IE中的dorpdown。当我查看dropdown.html页面,我可以看到下拉列表,所以我试图使用iframe。现在使用iframe我可以看到IE中的下拉菜单,但下拉列表不显示在顶部。它显示在网站上的其他图像的背后。我如何得到它的顶部的其他图像。

解决方案

此代码需要 allow_url_include = On 在您的php.ini,默认情况下禁用,因为它是 MASSIVE安全风险。这称为远程文件包含(RFI)漏洞。如果此网站上有PHP代码,则会在您的服务器上执行。



极不安全:

 <?php include(http://www.othersite.com/filename.html); ?> 

你可能想要的是:

 <?php print file_get_contents(http://www.othersite.com/filename.html); ?> 

但是,这在技术上是一个XSS漏洞。所以,如果你信任网站没有问题。但您可能希望在打印出来之前运行 Html Purifer


Hi i am trying to include a webpage link from another website into my website. how can i do this?

i tried

<?php web_include ('http://website.com/website.html') ; ?> but all the commands are not loading after this statement. I want to include another webpage into my homepage directly. my homepage is completely designed in php, but the other one is html or php.

i also tried <?php include("http://www.othersite.com/filename.html"); ?> but this html is not at all loading.

Possible Solution: ok this is what i am using

<iframe name="FRAMENAME" src="http://website.com/dropdown.html" width="1000" style="z-index:10000" height="40" frameborder="0" scrolling="no" allowautotransparency=true></iframe>

I am just including a dropdown menu for my index page. The CMS of the my site is restricting me from viewing the dorpdown in IE. When i view the dropdown.html page, i can see the dropdown, so I am trying to use iframe. Now using the iframe i can see the dropdown in IE as well, but the dropdown is not showing on the top. It is showing behind the other images on the site. How do i get it on top of the other images. z-index is not working for this.

解决方案

This code requires allow_url_include=On in your php.ini, which is disabled by default because it's a MASSIVE SECURITY RISK. This is called the Remote File Include (RFI) vulnerability. If there is PHP code on this site it will be executed on your server.

Extremely insecure:

<?php include("http://www.othersite.com/filename.html"); ?>

What you probably want is:

<?php print file_get_contents("http://www.othersite.com/filename.html"); ?>

However, this is technically an XSS vulnerability. So, if you trust the website there isn't a problem. But you probably want to run Html Purifer before printing it out.

这篇关于包括一个网站的php文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆