$post_data = 'response_type=code&client_id=XXX&redirect_uri=http%3A%2F%2Fxxx'; $ch = curl_init(); $agent = $_SERVER["HTTP_USER_AGENT"]; curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_URL, 'https://runkeeper.com/apps/authorize'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt'); curl_setopt($ch, CURLOPT_REFERER, "http://runkeeper.com"); curl_setopt($ch, CURLOPT_HEADER, 0); $response = curl_exec($ch); curl_close($ch); return $response;
jakies pomysly?