日期:2014-05-17  浏览次数:20873 次

新手!!!第一个程序,有问题,请各位兄长看看!
<form   action= "Login.asp "   name= "Login ">
<table>
<tr>
<td> 用户名: </td>
<td> <input   type= "text "   name= "UserName "   /> </td>
</tr>
<tr>
<td> 密     码: </td>
<td> <input   type= "password "   name= "UserPwd "   /> </td>
</tr>
<tr>
<td> &nbsp;&nbsp; </td>
<td> <input   type= "submit "   name= "button "   /> </td>
</tr>
</table>
</form>
<%
set   con   =   server.CreateObject( "adodb.Connection ")
con.open   "provider=SQLOLDE.1 "&_
"password= "&_
"User   ID= ' "&sa& " ' "&_
"initial   Catalog= ' "&192.168.0.105& " ' "&_
"Data   Sourse= ' "&Users& " ' "
UserName   =   Request.Form( "UserName ")
UserPwd   =   Request.Form( "UserPwd ")
sql   =   "select   *   from   Login   where   UserName= ' "+UserName+ " '   and   UserPwd   =   ' "+UserPwd+ " ' "
set   rs   =   server.CreateObject( "adodb.recordest ")
rs.execute   sql
if   rs.recordcount> 0
then  
Response.Write( " <script   lanauage=\ 'javascript\ '> alert(\ '登录成功!\ ') </script> ")
else   if   rs.recordcount   =0
Response.Write( " <script   lanauage=\ 'javascript\ '> alert(\ '登录失败!!!\ ') </script> ")
%>
这是我的登陆,你们看有什么问题啊?


------解决方案--------------------
if .. then 应该一行把