asp中不从登录页进入时的问题

来源:百度知道 编辑:UC知道 时间:2024/06/26 03:18:33
上面是一个例子,这个例子总共关联5个asp页,分别如下。

第1页:login.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>系统登录</title>
</head>

<body>
<form action = "loginCheck.asp" method="post" name="form1">
<table width="296" border="1" align="center" cellspacing="0" bordercolor="#6699CC">
<tr>
<td width="78" height="28" align="right">用户名:</td>
<td width="208"> <input name="sname" type="text" value="<%=request("sname")%>"></td>
</tr>
<tr>
<td height="28" align="right">密  

错误的地方很多,帮你全面的清理了一下,有兴趣的话可以加入asp群21281388交流。登陆的基本流程是正确的,虽然你没有用到数据库,不过作为练习还是可以的。所有修改后程序如下:

login.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>系统登录</title>
</head>

<body>
<form action = "loginCheck.asp" method="post" name="form1">
<table width="296" border="1" align="center" cellspacing="0" bordercolor="#6699CC">
<tr>
<td width="78" height="28" align="right">用户名:</td>
<td width="208"> <input name="sname" type="text">这个地方不要value</td>
</tr>
<tr>
<td height="28" align="right">密 码:&