title: Completely stuck trying to use Abraham Williams Twitter API libraries
body: <p>I’m working through Sam’s Teach Yourself Twitter API.. In Hour 8, there are simple instructions of setting up the consumer key, consumer secret (I already had a different php program using these succesfully) and using Abraham Williams libraries. I plugged the key,secret into config.php, used the define(’OAUTH_CALLBACK’, ‘http://localhost/callback.php’); with localhost and created a tinyurl for it (the work around if localhost doesnt work. Get the sign in to Twitter screen and then it goes to the redirect page that says:</p>
  
  <p>“Could not connect to Twitter. Refresh the page or try again later.”</p>
  
  <p>I’m completely dead in the water here. Once I get this working, I’ll be off and running, but I’m completely stuck. Any help would be appreciated.</p>
  
  <p>(In reponse to your questions:)</p>
  
  <p>They have a config.php file where they say to put in the KEY and SECRET, which I've done:</p>
  
  <pre><code>define('CONSUMER_KEY', 'KEY');
  define('CONSUMER_SECRET', 'SECRET');
  define('OAUTH_CALLBACK', 'http://localhost:8888/abeoauth/connect.php');
  </code></pre>
  
  <p>They book says to run index.php. Here's code from that:</p>
  
  <pre><code>/* Load required lib files. */
  session_start();
  require_once('twitteroauth/twitteroauth.php');
  require_once('config.php');
  
  /* If access tokens are not available redirect to connect page. */
  if (empty($_SESSION['access_token']) || empty($_SESSION['access_token']['oauth_token']) ||     empty($_SESSION['access_token']['oauth_token_secret'])) {
      header('Location: ./clearsessions.php');
  }
  /* Get user access tokens out of the session. */
  $access_token = $_SESSION['access_token'];
  
  /* Create a TwitterOauth object with consumer/user tokens. */
  $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET,     $access_token['oauth_token'], $access_token['oauth_token_secret']);
  
  /* If method is set change API call made. Test is called by default. */
  $content = $connection-&gt;get('account/verify_credentials');
  </code></pre>
  
  <p>Starting at index.php, like the book says, it does redirect to the "connect.php" page so it's as if I've put nothing in for the KEY variables at all..</p>