好看的古言温馨甜宠文:VBASP错了在哪?

来源:百度文库 编辑:高校问答 时间:2024/05/05 17:45:20
<%if
request.ServerVariables("query_string") <> "" then
name=request.QueryString("usname")
psw=request.QueryString("uspsw")
%>
<html>
<body>
yourname:<%=name%><br>
yourpassword:<%=psw%><br>
</body>
</html>
<%else%>
<html>
<body>
<form name="form1" method="get" action="tao.asp">
name:<input type="text" name="usname" ><br >
password:<input type="password" name="uspsw" ><br >
<input type="submit" value="提交">
</form>
</body>
</html>
<%end if%>
这个是哪里错了呢??为什么行不通呢?

代码没有问题,不过第一二行不知道是知道给转换的还是楼主就那么写的
<%if
request.ServerVariables("query_string") <> "" then

你在执行时应该会提示if有问题

if 的条件放在同一行就可以了。
<%
if request.ServerVariables("query_string") <> "" then

这里<%end if%>放到了最后,执行页面的时候,因为query_string为""所以 页面什么都没有

把<%end if%> 提到前面去
放在<html>的前面