<html> <head> <title>Geoloqi PHP SDK Access Token Example</title> </head> <body> <pre><?php error_reporting(E_ALL); ini_set('display_errors', 1); require '../Geoloqi.php'; $geoloqi = Geoloqi::createWithAccessToken('YOUR ACCESS TOKEN GOES HERE'); $response = $geoloqi->get('account/profile'); echo "Response for GET account/profile:\n\n"; print_r($response); echo "\nResponse for POST account/profile:\n\n"; $response = $geoloqi->post('account/profile', array('website' => 'http://example.org/my_cool_site')); print_r($response); ?> </pre> </body> </html>
<?php error_reporting(E_ALL); ini_set('display_errors', 1); session_start(); require '../Geoloqi.php'; $geoloqi = new Geoloqi('YOUR APP CLIENT ID GOES HERE', 'YOUR APP CLIENT SECRET GOES HERE', 'YOUR APP REDIRECT URI GOES HERE'); $name = 'geoloqi_auth'; if (isset($_SESSION[$name])) { $geoloqi->setAuth($_SESSION[$name]); } $page = isset($_GET['page']) ? $_GET['page'] : null; switch ($page) { case 'login': $geoloqi->login(); break; case 'logout': $geoloqi->logout(); unset($_SESSION[$name]); break; } if (isset($_GET['code'])) { $_SESSION[$name] = $geoloqi->getAuthWithCode($_GET['code']); } ?> <html> <head> <title>Geoloqi PHP SDK OAuth Example</title> </head> <body> <?php