Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added a check in the example code to show an error if CONSUMER key/se…

…cret is not set.
  • Loading branch information...
commit bfebd2f0c110241eeea4a79e0cd160b7b2e0802f 1 parent 441e1fb
Abraham Williams abraham authored

Showing 1 changed file with 10 additions and 0 deletions. Show diff stats Hide diff stats

  1. +10 0 connect.php
10 connect.php
@@ -5,6 +5,16 @@
5 5 * Get a request token from twitter and present authorization URL to user
6 6 */
7 7
  8 +/**
  9 + * Exit with an error message if the CONSUMER_KEY or CONSUMER_SECRET is not defined.
  10 + */
  11 +require_once('config.php');
  12 +if (CONSUMER_KEY === '' || CONSUMER_SECRET === '') {
  13 + echo 'You need a consumer key and secret to test the sample code. Get one from <a href="https://twitter.com/apps">https://twitter.com/apps</a>';
  14 + exit;
  15 +}
  16 +
  17 +/* Build an image link to start the redirect process. */
8 18 $content = '<a href="./redirect.php"><img src="./images/lighter.png" alt="Sign in with Twitter"/></a>';
9 19
10 20 /* Include HTML to display on the page */

0 comments on commit bfebd2f

Please sign in to comment.
Something went wrong with that request. Please try again.