×
Recent Posts News Torrents General Entertainment Questions
Login / Register

webtalks

How to make a website proxy / mirror of a website in PHP

Posted by: u/sain gosh 2 months ago c/Questions 132

I am trying to make a website proxy / mirror and i want to host it on my own server so is that possible to do so in pure PHP or any PHP class?




login or register to post a comment


Comments (2)


sizzlingkenny . 2 months ago

It is possible even though its not legal to proxy or mirror some one's website unless you have got the necessary permission to do so anyways you can check this code below for a good practice.
<?php
$curl_handle
=curl_init();
curl_setopt
($curl_handle,CURLOPT_URL,'http://www.google.com');
curl_setopt
($curl_handle,CURLOPT_CONNECTTIMEOUT,2);
curl_setopt
($curl_handle,CURLOPT_RETURNTRANSFER,1);
$buffer
= curl_exec($curl_handle);
curl_close
($curl_handle);
if (empty($buffer)){
print "Nothing returned from url.<p>";
}
else{
print $buffer;
}
?>

hope this is what you looking for.


sain gosh . 2 months ago

it actually work wow i been waiting for this so long.thanks thanks thanks