Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. function content($url) {
  2. $ch = curl_init();
  3. curl_setopt($ch, CURLOPT_URL, $url);
  4. curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13");
  5.  
  6. $headers = array
  7. (
  8. 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*;q=0.8',
  9. 'Accept-Language: ru,en-us;q=0.7,en;q=0.3',
  10. 'Accept-Encoding: gzip',
  11. #'Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.7'
  12. );
  13.  
  14. curl_setopt($ch, CURLOPT_PROXY, '81.177.27.248:31340');
  15. curl_setopt($ch, CURLOPT_PROXYUSERPWD, "FMqTVm:43DP4P");
  16.  
  17.  
  18. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  19. curl_setopt($ch, CURLOPT_HEADER, 0);
  20.  
  21. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  22. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  23. curl_setopt($ch,CURLOPT_ENCODING, "");
  24.  
  25. $cont = curl_exec($ch);
  26. return $cont;
  27. }
  28.  
  29. var_dump(content('https://testurl.ru'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement