代码:
if (isset($_GET['access_token'])) {
$_SESSION['oauth'] = $_GET['access_token'];
$usernameResult = file_get_contents("https://api.twitch.tv/kraken?oauth_token=" . $_SESSION['oauth']);
$json_decoded_usernameResult = json_decode($usernameResult, true);
echo $_SESSION['username'] = $json_decoded_usernameResult['token']['user_name'];
} else {
header('Location: https://api.twitch.tv/kraken/oauth2/authorize?response_type=token&client_id={clientID}&redirect_uri=http://127.0.0.1/thebot/oauth');
}
我的网址变为" http://127.0.0.1/thebot/oauth#access_token= {AccessToken}& scope ="。不知怎的,"?"被"#"取代。有没有人在我的代码中看到错误或知道解决方法所以我可以将其切换出来或其他什么?