<?php require_once "includes/functions.php"; $flights = new flights(); if ($argv[1] == "foursquare") { $flights->getFoursquare(); } if (isset($_REQUEST['frob'])) { if ($flights->authenticated) { $flights->setFlickr(); } exit; } if (isset($_REQUEST['code'])) { if ($flights->authenticated) { $flights->setFoursquare(); } exit; } //$mysqli = new mysqli($db_host, $db_username, $db_password, $db_name); //if (mysqli_connect_errno()) { // printf("Can't connect to MySQL Server. Errorcode: %s\n", mysqli_connect_error()); // exit; //} $action = $_REQUEST['action']; switch ($action) { case "airports": echo $flights->getGeoAirports(); break; case "toggle": if ($flights->authenticated == 1) {