Hey, thanks again for taking the time to look at my foolish problems. I’m just getting mega stressed with it and am probably missing something.
I have the authenticate url on a different page, and that code is as you have.
$twitchtv = new TwitchTV;
$authenticatedURL = $twitchtv->authenticate();
<a href="<?php echo $twitchtv->authenticate(); ?>" >Authenticate here </a>
Then on a different page, the url I have it redirected to, I have:
$token = $_GET['code'];
$twitch = new TwitchTV;
$code = (isset($_GET[‘code’])) ? $_GET[‘code’] : null;
if ($code !== null)
{
$authCode = $twitch->get_access_token($code);
echo $authCode."<br>";
echo $code;
} else {
echo "Error";
}
And this echo’s out my code that I got from the url. but I just get a blank where the authcode should be, I trying storing it in a database and it was just blank.
That is really the only code I have added. I have just put in my details where it says to do so.
I don’t want to post all the code here as it would be a bit of a mess. Basically my auth redirect file is:
http://localhost/test/auth/auth.php
And my redirect URL is http://localhost/test/try.php
I could move it to a live server if needed?
Sorry again, and thanks for all your help.