views:

141

answers:

3

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.

+17  A: 

This code requires allow_url_include=On in your php.ini. This is disabled by default because its as MASSIVE SECURITY RISK, this is called Remote File Include (RFI) vulnerability. If php code is on this site then 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")?&gt;

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

Rook
+1 for the bold uppercase **MASIVE SECURITY RISK**.
sarnold
Sure it isn't `allow_url_include`? I couldn't find any `remote_includes`.
nikic
@nikic yep your right. :)
Rook
A: 

ok this is what i am using

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

The page i am trying to include has a ul dropdown. It is from the site. This ul is not being displayed, i need to overlap on top of the other images that i have on the website. z-index is already there but no use since i am using iframe. Any fix for this?

Scorpion King
that's a good way to accomplish it, includes aren't the tool for that task. Sounds like the javascript of the included page that creates the dropdown isn't available within the iframe, or is interacting with your page's javascript. Try it on a clean, blank html page before including the iframe with other content.
Tchalvak
For more detailed debugging answers, I suggest including the actual urls that you're trying these with.
Tchalvak
This should be added to the question, not posted as an answer.
grossvogel
A: 

Just a basic recommendation, but it sounds like you're trying to debug complex functionality within a complex environment, which will only make it harder.

Debugging is easier if you break it down into component steps. In this case, I recommend:

Display the iframe on a blank html page. Make sure everything works in that simple case.

Display on the more complex page.

If it's still not working, comment out the javascript on the complex page to determine if that is causing the adverse interaction with the iframe page's javascript.

Going through the debuggging stepwise like that should simplify the process.

Tchalvak