ASP语句不运行

来源:百度知道 编辑:UC知道 时间:2024/06/30 15:45:31
if psdc="" then
response.write"<script>alert('请确认你的密码!');location.href='javascript:history.go(-1)';</script>"
else
response.write"<script>alert(‘两次输入的密码不一致!');location.href='javascript:history.go(-1)';</script>"
end if
为什么当满足条件时,else后的语句不执行?

response.write"<script>alert(‘两次输入的密码不一致!');location.href='javascript:history.go(-1)';</script>"

问题在上面这一句
“两次输入”前面的标点不是英文标点
改成这样
response.write"<script>alert('两次输入的密码不一致!');location.href='javascript:history.go(-1)';</script>"

完整测试
<%
psdc="123"
if psdc="" then
response.write"<script>alert('请确认你的密码!');location.href='javascript:history.go(-1)';</script>"
else
response.write"<script>alert('两次输入的密码不一致!');location.href='javascript:history.go(-1)';</script>"
end if
%>

你改成这样
<%
dim psdc
psdc=request.form("这里是你的确认密码框")(比如 request.form("psw")
if psdc="" then
response.write("<script>alert('请确认你的密码!');location.href='javascript:history.go(-1)';&l