Advertisement
Guest User

Untitled

a guest
Dec 18th, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. $url = 'http://www.***.com/testing.php';
  2.  
  3. $dataToSend = array(
  4. 'id' => 'value',
  5. 'other_id' => 'otherValue'
  6. );
  7.  
  8. $url += '?'.http_build_query($dataToSend);
  9. // $url is now:
  10. // http://somewhere.com/page.php?key=value&otherKey=otherValue
  11.  
  12. $ch = curl_init($url);
  13. curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  14. $response = curl_exec($ch);
  15.  
  16. if (!$response) {
  17. echo curl_error($response);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement