示例#1
0
<?php

require_once "src/FoursquareAPI.class.php";
//foursquare doc
//foursquare creds
$client_key = "xxxxx";
//add foursquare client key
$client_secret = "xxxxx";
//add foursquare client secret
$redirect_uri = "xxxx";
//add your redirect uri
// Load the Foursquare API library
$foursquare = new FoursquareAPI($client_key, $client_secret);
// If the link has been clicked, and we have a supplied code, use it to request a token
if (array_key_exists("code", $_GET)) {
    $token = $foursquare->GetToken($_GET['code'], $redirect_uri);
}
//conncect to db
$link = mysql_connect("xxDB HOSTxxx", "xxDB USER NAMExxx", "xxxDB Passxxx");
if (!$link) {
    die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db("xxxDB Namexxx");
if (!$db_selected) {
    die('Can\'t use foo : ' . mysql_error());
}
?>
<!doctype html>
<html>
<head>
	<title>Add your account</title>