Basic Twitch Connect OAuth Help

Hello, firstly, thanks so much for replying, this has been doing my head in for days, it is probably too advanced for me but I really need it.

I added this code to check what you wanted:

$token = $_GET['code'];

$twitchtv = new TwitchTV;

 $token = (isset($_GET['code'])) ? $_GET['code'] : null;

 if ($token !== null)

{
    $authCode = $twitchtv->get_access_token($token);
echo $authCode . "<br>";
echo $token;

} else {
echo "Error";
}

Basically it displays my $token but not my $authCode.

So it looks like a problem with my POST? Or something I am completely missing. Maybe I could use a different curl? I am running this on local host, is it worth trying it on live to see if that makes a difference?

Thanks again for your help, sorry I am sooo nooby and stuck.