[support] Finding a device ID or mobile phone number

Scott scott at bscottholmes.com
Thu Jun 24 18:57:30 UTC 2010


I'd asked about this earlier and indeed the only solution I've found
involves x-something headers as suggested by Peter Horn.  I did manage
to find a possible function:

  function getPhoneNumber ()  {
    if (isset($_SERVER['HTTP_X_NETWORK_INFO']))  {
      $str1 = $_SERVER['HTTP_X_NETWORK_INFO'];  
      $getstr1 = preg_replace('/(.*,)( 11 [d ])(,.*)/ i','',$str1);  
      return $getstr1;  
    } 
    elseif (isset($_SERVER['HTTP_X_UP_CALLING_LINE_ID']))  {
      $getstr2 = $_SERVER['HTTP_X_UP_CALLING_LINE_ID'];  
      return $getstr2;  
    }
    elseif (isset($_SERVER['HTTP_X_UP_SUBNO']))  {
      $str3 = $_SERVER['HTTP_X_UP_SUBNO'];  
      $getstr3 = preg_replace('/(.*)( 11 [d ])(.*)/ i','',$str3);  
      return $getstr3;  
    }
    elseif (isset($_SERVER['DEVICEID']))  {
      return $_SERVER ['DEVICEID'];  
    }
    else  {
      return false;  
    }
  }

I modified this slightly this from

http://www.programingreference.com/php-wap-development-for-the-problems-encountered/

I'm trying this out now but again my cell phone has been "borrowed" fro
the day so my results are inconclusive.




More information about the support mailing list