I'm using this guide to get a quick and dirty OAuth authentication so I can play around with the API. Unfortunately his tutorial seems spotty. The EpiOAuth.php file referenced wasn't found in his link and I had to do a google search to find a copy. Upon running index.php for the first time to get my token I received a 'missing parameter' error on the $results = $foursquareObj->getAuthorizeUrl() line in index.php. Even by manually placing my callback URL in, my token comes back as "h":
Login Via Foursquare
string(1) "h"
Which, obviously, isn't right. How am I (he) doing this wrong?
This isn't a direct answer to your question, but is pretty straight forward for getting an OAuth token. I'm just getting started with foursquare, and this is about all I've got. It does not do any kind of error checking, but it does get an OAuth token which allows you to poke at the API.
localhost/scripts/secrets.php
localhost/scripts/4sq_Login.php
localhost/scripts/4sq_Callback.php
localhost/index.htm
I'm not good at explaining, so I hope you can see what I'm doing, and can build on it as necessary.
(Since PHP deals with the local file system it is actually preferable to relocate your secrets.php to a location outside of the web server path. Just in case :)