Skip to content

Instantly share code, notes, and snippets.

@zaneclaes
Created October 25, 2014 22:10
Show Gist options
  • Save zaneclaes/bc2b1d1449d7b0f2427f to your computer and use it in GitHub Desktop.
Save zaneclaes/bc2b1d1449d7b0f2427f to your computer and use it in GitHub Desktop.
if(!isset($_POST['device']) || !isset($_POST['os_version'])) {
die('missing params');
}
$params = $_POST;
$params['ip'] = $_SERVER['REMOTE_ADDR'];
// Now we'd query the database for a Referral object match on device, os_version, and ip
// We could also restrict our query to recently created Referral objects and/or objects
// which have not been "Claimed."
// Once the object is found, we would modify it to be "claimed" by adding some user-specific
// information, such as a user ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment