Created
December 11, 2012 18:46
-
-
Save tylerreed/4260968 to your computer and use it in GitHub Desktop.
Mxit - Get Headers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.