获取手机型号、IP(有待验证)
Java代码
<%
String type = request.getHeader("User-Agent");
String ip = request.getHeader("X-Forward-For");
String pcIP = request.getRemoteAddr();
String number1 = request.getHeader("X-Up-Calling-Line-Id");
String number2 = request.getHeader("x-up-calling-line-id");
System.out.println("\n");
System.out.println("型号:" + type);
System.out.println("---------------------");
System.out.println("IP:" + ip);
System.out.println("---------------------");
System.out.println("PC IP:" + pcIP);
System.out.println("---------------------");
System.out.println("号1:" + number1);
System.out.println("---------------------");
System.out.println("号2:" + number2);
System.out.println("---------------------");
%>
<%
String type = request.getHeader("User-Agent");
String ip = request.getHeader("X-Forward-For");
String pcIP = request.getRemoteAddr();
String number1 = request.getHeader("X-Up-Calling-Line-Id");
String number2 = request.getHeader("x-up-calling-line-id");
System.out.println("\n");
System.out.println("型号:" + type);
System.out.println("---------------------");
System.out.println("IP:" + ip);
System.out.println("---------------------");
System.out.println("PC IP:" + pcIP);
System.out.println("---------------------");
System.out.println("号1:" + number1);
System.out.println("---------------------");
System.out.println("号2:" + number2);
System.out.println("---------------------");
%>
据说已经不能获得手机号码,被移动屏蔽,得到移动批准的SP才可以获得。
如何判断访问者是来自哪个浏览器或者移动电话?
可以通过检查HTTP_USER_AGENT标签来判断。例如试着使用Microsoft Internet Explorer访问一个站点的时候,HTTP_USER_AGENT将返回:Mozilla/4.0 (compatible;MSIE 5.0; Windows 98);在同样的情况下使用Nokia 7110访问这个站点,HTTP_USER_AGENT就会是:Nokia7110/1.0(04.73)。据此可以判断用户代理是什么类型的。
Java代码
<%
String type = request.getHeader("User-Agent");
String ip = request.getHeader("X-Forward-For");
String pcIP = request.getRemoteAddr();
String number1 = request.getHeader("X-Up-Calling-Line-Id");
String number2 = request.getHeader("x-up-calling-line-id");
System.out.println("\n");
System.out.println("型号:" + type);
System.out.println("---------------------");
System.out.println("IP:" + ip);
System.out.println("---------------------");
System.out.println("PC IP:" + pcIP);
System.out.println("---------------------");
System.out.println("号1:" + number1);
System.out.println("---------------------");
System.out.println("号2:" + number2);
System.out.println("---------------------");
%>
<%
String type = request.getHeader("User-Agent");
String ip = request.getHeader("X-Forward-For");
String pcIP = request.getRemoteAddr();
String number1 = request.getHeader("X-Up-Calling-Line-Id");
String number2 = request.getHeader("x-up-calling-line-id");
System.out.println("\n");
System.out.println("型号:" + type);
System.out.println("---------------------");
System.out.println("IP:" + ip);
System.out.println("---------------------");
System.out.println("PC IP:" + pcIP);
System.out.println("---------------------");
System.out.println("号1:" + number1);
System.out.println("---------------------");
System.out.println("号2:" + number2);
System.out.println("---------------------");
%>
据说已经不能获得手机号码,被移动屏蔽,得到移动批准的SP才可以获得。
如何判断访问者是来自哪个浏览器或者移动电话?
可以通过检查HTTP_USER_AGENT标签来判断。例如试着使用Microsoft Internet Explorer访问一个站点的时候,HTTP_USER_AGENT将返回:Mozilla/4.0 (compatible;MSIE 5.0; Windows 98);在同样的情况下使用Nokia 7110访问这个站点,HTTP_USER_AGENT就会是:Nokia7110/1.0(04.73)。据此可以判断用户代理是什么类型的。