I can't get it to work. I rewrote my auth code to the following but it still doesn't work. Isn't there w roking PHP/cURL example of Reddits link submit out there? I can't find anything.
$ch = curl_init('
https://ssl.reddit.com/api/v1/access_token
');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Basic '.base64_encode('CLIENT:SECREY')));
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch ,CURLOPT_POSTFIELDS, http_build_query(array('grant_type' => 'code', 'duration' => 'permanent', 'response_type' => 'code', 'state' => 'STATE', 'scope' => 'identity,mysubreddits,read,save,submit')));
$return = curl_exec($ch);
curl_close($ch);
$token = json_decode($return, true);