, works great.
public function oauth($redirurl){
$athlete = null;
if(isset($_GET['code']) and !is_null($_GET['code'])){
$post_data = array(
'client_id' => '<yourclientid>',
'client_secret' => '<yourclientsecret>',
'code' => $_GET['code']
);
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($post_data),
),
);
$context = stream_context_create($options);
$token = json_decode($result)->access_token;
if($token != null){
$_SESSION['stravatoken'] = $token;
header('Location: '.$redirurl);
}
}
}
public function getAthlete(){
}
Op maandag 3 maart 2014 06:47:20 UTC+1 schreef Patrick Lazalita: