SHARE
TWEET

Untitled

a guest Jun 20th, 2011 218 Never
  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;
RAW Paste Data
Top