Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

include a website in php file

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.

like image 707
Scorpion King Avatar asked Nov 27 '22 01:11

Scorpion King


1 Answers

This code requires allow_url_include=On in your php.ini, which is disabled by default because it's REMOTE CODE EXECUTION, one of the worst you can have in PHP. 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.

like image 141
rook Avatar answered Dec 05 '22 16:12

rook