Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 20th, 2011  |  syntax: PHP  |  size: 0.77 KB  |  views: 214  |  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. $session = curl_init();
  2. curl_setopt($session, CURLOPT_HEADER, true);
  3. curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
  4. curl_setopt($session, CURLOPT_AUTOREFERER, true);
  5. curl_setopt($session, CURLOPT_SSL_VERIFYPEER, false);
  6. curl_setopt($session, CURLOPT_SSL_VERIFYHOST, 2);
  7. curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
  8. curl_setopt($session, CURLOPT_VERBOSE, true);
  9.  
  10. curl_setopt($session, CURLOPT_USERAGENT, 'myAgent');
  11. curl_setopt($session, CURLOPT_POST, true);
  12. curl_setopt($session, CURLOPT_URL, "https://1.domain.com");
  13. curl_setopt($session, CURLOPT_POSTFIELDS, 'code1=val1;code2=val2;');
  14. header("Content-Type: text/plain");
  15.  
  16.  
  17. $return = curl_exec($session);
  18.  
  19. $error = curl_error($session);
  20.  
  21. if($error) echo "error!";
  22.  
  23. curl_close($session);
  24.  
  25. echo $return;
clone this paste RAW Paste Data