下面是一个注册的代码 有几个简单问题不是很懂

来源:百度知道 编辑:UC知道 时间:2024/06/22 19:05:19
if Request("action")="save" then
if Request("username")="" then
response.write "<script LANGUAGE='javascript'>alert('请输入你的用户名!');history.go(-1);</script>"
response.end
end if
if Request("pass")="" then
response.write "<script LANGUAGE='javascript'>alert('请输入你的密码!');history.go(-1);</script>"
response.end
end if
if Request("pass1")<>Request("pass") then
response.write "<script LANGUAGE='javascript'>alert('二次密码一不致!');history.go(-1);</script>"
response.end
end if

我有三个问题
1.if Request("action")="save" then
if Request("username")="" then
这两句话什么意思,具体指的是什么?
2.为什么每个句子都要有response.end
3.if语句必须要以end if结尾吗,end if后面可以不要求语句吗
谢谢

1.if Request("action")="save" then
if Request("username")="" then
Request("name")表示表单提交上来的值[get或post的都可以],比如提交后的网址是
http://hi.baidu.com/get.asp?name=arliang
那么在get.asp页面里面Request("name")的值就是arliang。

2.为什么每个句子都要有response.end
response.end是响应结束的标志

ASP开发中可能有时候会用大段的if... else 的判断,不过如果是动态Response.write的内容,你想更方便阅读代码,可以用Response.End()来终端ASP的执行,也就类似于Break的用法
【摘自http://blog.csdn.net/mikel/archive/2008/04/14/2289700.aspx

3.if语句必须要以end if结尾吗,end if后面可以不要求语句吗
if...then语句,如果then后换行了就要以end if结束,如
'-----------------
if a > b then
c = a
a = b
b = c
end if
'-----------------
如果是单行就不用,如
'--