servervariables集合,论坛里流行的显示自己IP和浏览器类型的签名就来自于这个强大的集合了。
代码如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>练习ServerVariables</title> <style type="text/css"> <!-- .css { font-family: "宋体"; font-size: 12px; line-height: 18px; font-weight: bold; color: #000066; text-decoration: none; padding-left: 10px; border-top-width: 1px; border-right-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-left-style: solid; border-top-color: #3399FF; border-right-color: #3399FF; border-left-color: #3399FF; } .css1 { font-family: "宋体"; font-size: 12px; line-height: 18px; color: #000000; text-decoration: none; padding-left: 10px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-right-color: #3399FF; border-bottom-color: #3399FF; border-left-color: #3399FF; } --> </style> </head> <body> <table width="780" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="25" background="images/1.gif" class="css">※用户来访信息※</td> </tr> <tr> <td class="css1"><b>您的真实IP是:</b><%=request.ServerVariables("REMOTE_ADDR")%>,<b>浏览器:</b><%=request.ServerVariables("HTTP_USER_AGENT")%></td> </tr> </table> </body> </html> |