<input type="text" name="location" /> <input type="submit" value="Search!" /> </form> <p>Searching for venues near <?php echo $location; ?> </p> <hr /> <?php // Set your client key and secret $client_key = "<your client key>"; $client_secret = "<your client secret>"; // Load the Foursquare API library $foursquare = new FoursquareAPI($client_key, $client_secret); // Generate a latitude/longitude pair using Google Maps API list($lat, $lng) = $foursquare->GeoLocate($location); // Prepare parameters $params = array("ll" => "{$lat},{$lng}"); // Perform a request to a public resource $response = $foursquare->GetPublic("venues/search", $params); $venues = json_decode($response); foreach ($venues->response->groups as $group) { ?> <h2><?php echo $group->name; ?> </h2> <ul> <?php foreach ($group->items as $venue) {