用ASP搞了半天的登录都没搞好。。

来源:百度知道 编辑:UC知道 时间:2024/06/04 08:25:21
<%@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>test</title>
<%
sub check()
dim username,pass
username=request.form("username")
pass=request.form("pass")
if username="" then
%>
<script language="vbscript">
<!--
alert("用户名不能为空")
-->
</script>
<%end if%>
<%
if pass="

不好用+QQ29026022

<%
sub check()
dim username,pass
username=request.form("username")
pass=request.form("pass")
if username="" then
%>
<script language="vbscript">
<!--
alert("用户名不能为空")
-->
</script>
<%end if%>
<%
if pass="" then
%>
<script language="vbscript">
<!--
alert("密码不能为空")
-->
</script>
<%end if
end sub
%>
这段话出错了去掉
改成
<input type="submit" onclick="vbscript:check()"> 把这个改成<input type="submit">
在><form action="1.asp?a=1" method="post" name="form1" id="form1" onsubmit="javascript:check()">
<input type="text" name="username" id="username" />