I have tried using iframes, but it has not worked because of the same-origin error.
<div align="center">
<iframe src="http://sms.webzworld.com/" style="overflow:hidden"></iframe>
</div>
I tried a little bit of ajax but I was unsuccessful; I have very little knowledge of Ajax and jQuery, so I did not go too deep into this topic. That said, if there is a solution using Ajax and jQuery then I don't mind looking into it.
Now i am having a look at curl library in php to solve my problem. It doesnt load the external website but in a very hap hazard way.The code i use is as follows:
<?php
function Get_Domain_Contents($url){
$ch = curl_init();
$timeout = 5;
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$url = 'http://sms.webzworld.com/';
$html = Get_Domain_Contents($url);
$html = "<base href='{$url}' />" . $html;
?>
<div src=""><?php echo $html; ?></div>
In the plain white section is where i want the external website to load. But after i use the curl code mentioned above i get this output.
Output after the curl code used
As you can see that the external website overlaps my own website.
So can anybody help me out with an effective solution?