Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Sep 26th, 2013  |  syntax: None  |  size: 1.71 KB  |  views: 36  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. $url  = "https://www.xxx.xxx";
  2. $post = "";# all data that going to send
  3.  
  4. $ch = curl_init();
  5. curl_setopt($ch, CURLOPT_URL, $url);
  6. curl_setopt($ch, CURLOPT_POST, true);
  7. curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  8. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  9.  
  10. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  11. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  12. curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0');
  13.  
  14. $exe  = curl_exec($ch);
  15. $getInfo = curl_getinfo($ch);
  16.  
  17. if ($exe === false) {
  18.     $output = "Error in sending";
  19.     if (curl_error($ch)){
  20.         $output .= "n". curl_error($ch);
  21.     }
  22. } else if($getInfo['http_code'] != 777){
  23.     $output = "No data returned. Error: " . $getInfo['http_code'];
  24.     if (curl_error($ch)){
  25.         $output .= "n". curl_error($ch);
  26.     }
  27. }
  28.  
  29. curl_close($ch);
  30.  
  31. echo $output;
  32.        
  33. $url  = "https://www.xxx.xxx";
  34. $post = "";# all data that going to send
  35.  
  36. $ch = curl_init();
  37. curl_setopt($ch, CURLOPT_URL, $url);
  38. curl_setopt($ch, CURLOPT_POST, true);
  39. curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  40. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  41.  
  42. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  43. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  44. curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT    5.0');
  45.  
  46. $exe  = curl_exec($ch);
  47. $getInfo = curl_getinfo($ch);
  48.  
  49. if ($exe === false) {
  50. $output = "Error in sending";
  51. if (curl_error($ch)){
  52.     $output .= "n". curl_error($ch);
  53. }
  54. } else if($geInfo['http_code'] != 777){        //here $geInfo should be $getInfo
  55. $output = "No data returned. Error: " . $geInfo['http_code'];//as preline
  56. if (curl_error($ch)){
  57.     $output .= "n". curl_error($ch);
  58. }
  59. }
  60.  
  61. curl_close($c);  //$c should be $ch
  62.  
  63. echo $output;