Skip to content

Instantly share code, notes, and snippets.

@phamquocbuu
Created January 2, 2014 03:41
Show Gist options
  • Save phamquocbuu/8214738 to your computer and use it in GitHub Desktop.
Save phamquocbuu/8214738 to your computer and use it in GitHub Desktop.
PHP CURL post data, port, useragent
<?php
$url = "http://new.sell.dev/distributor";
$post_data = array (
"key" => "jAun729*hA6T6sE2nP3!m3@a4hw",
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_PORT, 69);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; rv:2.2) Gecko/20110201');
// we are doing a POST request
curl_setopt($ch, CURLOPT_POST, 1);
// adding the post variables to the request
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
$output = curl_exec($ch);
curl_close($ch);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment