Include other website PHP

by saravana 2014-02-25 13:48:09

To include a webpage link from another website into a website,


Method 1:

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


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.

Method 2:

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


This is technically an XSS vulnerability. So if you trust the website then there isn't a problem.

Method 3:

$ch = curl_init("http://tufing.com");
curl_exec($ch);


CURL is a way you can hit a URL from your code to get a html response from it.cURL means client URL which allows you to connect with other URLS and use there responses in your code.

Tagged in:

1132
like
0
dislike
0
mail
flag

You must LOGIN to add comments