Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "http://www.mywebsite1.com/myfavoritestreams");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
- $headers = array();
- $headers[] = "Host: www.wiz1.net";
- $headers[] = "Connection: keep-alive";
- $headers[] = "Upgrade-Insecure-Requests: 1";
- $headers[] = "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36";
- $headers[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8";
- $headers[] = "Referer: http://www.mywebsite1.com";
- $headers[] = "Accept-Encoding: gzip, deflate";
- $headers[] = "Accept-Language: en-US,en;q=0.9";
- $headers[] = "Cookie: __cfduid=d00d780044d6524dab736999f38359bba1534699518; _ga=GA1.2.1974576514.1534699525; _gid=GA1.2.795232845.1540262479";
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- $filename = curl_exec($ch);
- if (curl_errno($ch)) {
- echo 'Error:' . curl_error($ch);
- }
- curl_close ($ch);
- $string_to_replace="mywebsite1";
- $replace_with="mywebsite2";
- replace_string_in_file($filename, $string_to_replace, $replace_with);
- function replace_string_in_file($filename, $string_to_replace, $replace_with){
- $content=file_get_contents($filename);
- $content_chunks=explode($string_to_replace, $content);
- $content=implode($replace_with, $content_chunks);
- file_put_contents($filename, $content);
- }
Add Comment
Please, Sign In to add comment