Pampour

Send POST data with PHP

Feb 28th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.27 KB | None | 0 0
  1. function sendPostData($url, $post = array()){
  2.     $ch = curl_init($url);
  3.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  4.     curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
  5.     curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($post));
  6.     return curl_exec($ch);
  7. }
Advertisement
Add Comment
Please, Sign In to add comment