Advertisement
kakatoji

crl

Nov 12th, 2020
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 KB | None | 0 0
  1. <?php
  2. function post_0($url,$ua,$data){
  3. $ch=curl_init();
  4. curl_setopt_array($ch,array(
  5. CURLOPT_URL=>$url,
  6. CURLOPT_POST=>1,
  7. CURLOPT_POSTFIELDS=>$data,
  8. CURLOPT_RETURNTRANSFER=>1,
  9. CURLOPT_USERAGENT=>$ua,
  10. CURLOPT_TIMEOUT=>15,
  11. CURLOPT_CONNECTTIMEOUT=>15,
  12. CURLOPT_FOLLOWLOCATION=>1,));
  13. $res=curl_exec($ch);
  14. curl_close($ch);
  15. return $res;
  16. }
  17. function get_0($url,$ua){
  18. $ch=curl_init();
  19. curl_setopt_array($ch,array(
  20. CURLOPT_URL=>$url,
  21. CURLOPT_RETURNTRANSFER=>1,
  22. CURLOPT_USERAGENT=>$ua,
  23. CURLOPT_TIMEOUT=>15,
  24. CURLOPT_CONNECTTIMEOUT=>15,
  25. CURLOPT_FOLLOWLOCATION=>1));
  26. $res=curl_exec($ch);
  27. curl_close($ch);
  28. return $res;
  29. }
  30. function post_1($url,$header,$data){
  31. $ch=curl_init();
  32. curl_setopt_array($ch,array(
  33. CURLOPT_URL=>$url,
  34. CURLOPT_POST=>1,
  35. CURLOPT_POSTFIELDS=>$data,
  36. CURLOPT_RETURNTRANSFER=>1,
  37. CURLOPT_HTTPHEADER=>$header,
  38. CURLOPT_TIMEOUT=>15,
  39. CURLOPT_CONNECTTIMEOUT=>15,
  40. CURLOPT_FOLLOWLOCATION=>1,));
  41. $res=curl_exec($ch);
  42. curl_close($ch);
  43. return $res;
  44. }
  45. function get_1($url,$header){
  46. $ch=curl_init();
  47. curl_setopt_array($ch,array(
  48. CURLOPT_URL=>$url,
  49. CURLOPT_RETURNTRANSFER=>1,
  50. CURLOPT_HTTPHEADER=>$header,
  51. CURLOPT_TIMEOUT=>15,
  52. CURLOPT_CONNECTTIMEOUT=>15,
  53. CURLOPT_FOLLOWLOCATION=>1,));
  54. $res=curl_exec($ch);
  55. curl_close($ch);
  56. return $res;
  57. }
  58.  
  59. function post_2($url,$header,$data,$cookies){
  60. $ch=curl_init();
  61. curl_setopt_array($ch,array(
  62. CURLOPT_URL=>$url,
  63. CURLOPT_POST=>1,
  64. CURLOPT_POSTFIELDS=>$data,
  65. CURLOPT_RETURNTRANSFER=>1,
  66. CURLOPT_HTTPHEADER=>$header,
  67. CURLOPT_COOKIEJAR=>$cookies,
  68. CURLOPT_COOKIEFILE=>$cookies,
  69. CURLOPT_FOLLOWLOCATION=>1,));
  70. $res=curl_exec($ch);
  71. curl_close($ch);
  72. return $res;
  73. }
  74. function get_2($url,$header,$cookies){
  75. $ch=curl_init();
  76. curl_setopt_array($ch,array(
  77. CURLOPT_URL=>$url,
  78. CURLOPT_RETURNTRANSFER=>1,
  79. CURLOPT_HTTPHEADER=>$header,
  80. CURLOPT_COOKIEJAR=>$cookies,
  81. CURLOPT_COOKIEFILE=>$cookies,
  82. CURLOPT_FOLLOWLOCATION=>1,));
  83. $res=curl_exec($ch);
  84. curl_close($ch);
  85. return $res;
  86. }
  87.  
  88. function post_($url,$ua,$data,$proxy,$port,$ptype,$cookies){
  89. $headers = array('Accept: gzip',
  90. 'Accept-Language: en-US,en;q=0.5',
  91. 'Accept-Encoding: gzip, deflate',
  92. 'Connection: keep-alive','referrer: '.$ref);
  93. $ch = curl_init();
  94. curl_setopt_array($ch, array(
  95. CURLOPT_URL => $url,
  96. CURLOPT_PROXY => $proxy,
  97. CURLOPT_PROXYPORT => $port,
  98. CURLOPT_PROXYTYPE => $ptype,
  99. CURLOPT_HTTPHEADER => $headers,
  100. CURLOPT_COOKIEFILE => $cookies,
  101. CURLOPT_COOKIEJAR => $cookies,
  102. CURLOPT_POST => 1,
  103. CURLOPT_POSTFIELDS => $data,
  104. CURLOPT_RETURNTRANSFER => 1,
  105. CURLOPT_USERAGENT => $ua,
  106. CURLOPT_TIMEOUT => 15,
  107. CURLOPT_CONNECTTIMEOUT => 15,
  108. CURLOPT_FOLLOWLOCATION => 1,
  109. ));
  110. $res = curl_exec($ch);
  111. curl_close($ch);
  112. return $res;
  113. }
  114. function get_($url,$ua,$proxy,$port,$ptype,$cookies){
  115. $headers = array('Accept: gzip',
  116. 'Accept-Language: en-US,en;q=0.5',
  117. 'Accept-Encoding: gzip, deflate',
  118. 'Connection: keep-alive','referrer: '.$ref);
  119.  
  120. $ch = curl_init();
  121. curl_setopt_array($ch, array(
  122. CURLOPT_URL => $url,
  123. CURLOPT_PROXY => $proxy,
  124. CURLOPT_PROXYPORT => $port,
  125. CURLOPT_PROXYTYPE => $ptype,
  126. CURLOPT_HTTPHEADER => $headers,
  127. CURLOPT_COOKIEJAR => $cookies,
  128. CURLOPT_COOKIEFILE => $cookies,
  129. CURLOPT_RETURNTRANSFER => 1,
  130. CURLOPT_USERAGENT => $ua,
  131. CURLOPT_TIMEOUT => 15,
  132. CURLOPT_CONNECTTIMEOUT => 15,
  133. CURLOPT_FOLLOWLOCATION => 1,
  134. ));
  135. $res = curl_exec($ch);
  136. curl_close($ch);
  137. return $res;
  138. }
  139.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement