function request ($url, $postdata = null, $cookiefile = 'cookie.txt') {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31');
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
if ($postdata) {
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
}
$html = curl_exec($ch);
curl_close($ch);
return $html;
}
// ****************
// [ MAIN CODE ]
// ****************
$post = [
'manufacturer' => 'Apple',
'esn' => '123456789111111',
'g-recaptcha-response:' => '',
];
$html = request('https://secure.sprintbuyback.com/bbt/includes/ajax/deviceIdentification.php', $post);
echo $html;