HTTP_HOST = Request.ServerVariables("HTTP_HOST")这个语句是什么意思

来源:百度知道 编辑:UC知道 时间:2024/05/19 15:10:13
asp中 HTTP_HOST = Request.ServerVariables("HTTP_HOST")这个语句是什么意思

Request.ServerVariables("SCRIPT_NAME") 可以获得当前的文件在服务器中的路径,比如本窗口地址栏中的question/79958994.html
Request.ServerVariables("HTTP_HOST") 可以获得当前网页的服务器域名,比如本窗口地址栏的zhidao.baidu.com
Request.ServerVariables其它功能自己琢磨一下,
Split()是数组函数,如:
aa="我/你/他/我们/你们/他们"
cc=Split(aa,"/")
cc(0)=我
cc(1)=你
cc(2)=他
cc(3)=我们
cc(4)=你们
cc(5)=他们

Request.ServerVariables("http_host")
获取域名,形如www.csdn.net
Request.ServerVariables("url")
获取相对域名的http地址,参数除外
如:
http://expert.csdn.net/Expert/topic/view.asp?id=123456
那么,
Request.ServerVariables("http_host")得到
expert.csdn.net
Request.ServerVariables("url")得到
/Expert/t