Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * get_oauth_guid.php
- *
- *
- */
- /*
- * Get the http.php file from http://www.phpclasses.org/httpclient
- */
- $localhost = 'localhost';
- $dbuser = 'user';
- $dbpass = 'password';
- $dbname = 'dbname';
- $dbtable = 'dbtable';
- $f = $_GET["f"];
- $link = mysql_connect($localhost, $dbuser, $dbpass);
- if (!$link)
- {
- die('Could not connect: ' . mysql_error()); // remove ?
- }
- $dbselect=mysql_select_db($dbname);
- if (!$dbselect)
- {
- die ("Can't use database $dbname! : " . mysql_error()); // remove ?
- }
- $sql = "SELECT accesstoken, accesstokensecret, guid FROM tmp_oauth WHERE guid = '$f'";
- $query = mysql_query($sql) or die("Anfrage nicht erfolgreich");
- if(mysql_num_rows(mysql_query($sql)))
- {
- while ($getcode = mysql_fetch_array($query)){
- $accesstoken = $getcode['accesstoken'];
- $accesstokensecret = $getcode['accesstokensecret'];
- }
- ?>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <title>Discogs OAuth client results</title>
- </head>
- <body>
- <?php
- echo "AccessToken=" . $accesstoken . "<br/>";
- echo "AccessTokenSecret=" . $accesstokensecret . " <br/><br/>";
- echo "GUID=" . $f . " <br/><br/>";
- echo "You can now close this window. <br/><br/>";
- ?>
- </body>
- </html>
- <?php
- }
- else
- {
- ?>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <title>OAuth client error</title>
- </head>
- <body>
- <h1>OAuth client error</h1>
- <pre>Error: <?php echo HtmlSpecialChars($client->error); ?></pre>
- </body>
- </html>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement