Skip to content

Instantly share code, notes, and snippets.

@tylerreed
Created December 11, 2012 18:46
Show Gist options
  • Save tylerreed/4260968 to your computer and use it in GitHub Desktop.
Save tylerreed/4260968 to your computer and use it in GitHub Desktop.
Mxit - Get Headers
<?php
public function getMxitHeaders() {
if ( ! empty( $_SERVER["HTTP_X_MXIT_USERID_R"] ) ) {
$mxit->useragent = $_SERVER["HTTP_X_DEVICE_USER_AGENT"];
$mxit->contact = $_SERVER["HTTP_X_MXIT_CONTACT"];
$mxit->nick = $_SERVER["HTTP_X_MXIT_NICK"];
$mxit->userid = $_SERVER["HTTP_X_MXIT_ID_R"]; // Deprecated (soon to be discontinued)
$mxit->mxitid = $_SERVER["HTTP_X_MXIT_USERID_R"];
$mxit->login = $_SERVER["HTTP_X_MXIT_LOGIN"];
$mxit->locations = $_SERVER["HTTP_X_MXIT_LOCATION"];
$mxit->profile = $_SERVER["HTTP_X_MXIT_PROFILE"];
$mxit->pixels = $_SERVER["HTTP_UA_PIXELS"];
} else {
$mxit = NULL;
}
return $mxit;
}
?>
@tylerreed
Copy link
Author

Just some basic code to grab Mxit headers in PHP. It will also help to determine if your app is running within the Mxit environment and grab basic Mxit user details. Feel free to fork or improve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment