给大家看一段asp代码。请问这是如何实现与数据库的连接的,另外function函数的作用为何没有体现?

来源:百度知道 编辑:UC知道 时间:2024/09/23 06:37:42
<!--#include file="inc/conn.asp" -->
<!--#include file = "CheckLogin.asp" -->
<!--#include file = "inc/zhuru.asp" -->
<style type="text/css">
<!--
.STYLE9 {color: #003300; font-size: 12px; }
.STYLE11 {font-size: 14px}
-->
</style>
<Script language=vbScript>
function CheckValue(thisform) 'thisform是形式参数 且CheckValue是自定义函数 其功能为大括号内的函数体'
{

if (thisform.Name.value.length == 0){
conn.close;
set conn=nothing;
alert ('请输入用户名。');
return false;
}

if (thisform.Name.value.length > 20){
alert ('用户名过长。');
return false;
}

else if (thisform.Pwd.value.length == 0){
alert ('请输入密码。');
return false;
}
if (thisform.Pwd.value.length > 30){
alert ('密码过长。');
return false;

<!--#include file="inc/conn.asp" -->
一般情况下都写在这个包含文件里面

你定义的function是thisform, 下面引用的却是form1,你可以随便改一个,这样就可以知道那个是对的了、

<!--#include file=conn.asp-->
<!--#include file=config.asp-->

<%

session("code")=RndNumber(5)
m=request.querystring("m")
Select Case m
Case "1" msg="输入有误,用户名称错误"
Case "2" msg="输入有误,口令错误"
End Select

%>
<HTML>
<HEAD>
<TITLE>后台登陆</TITLE>
<style type="text/css">
td {
font-size:14px;
}
</style>
<script language="vbscript">
Function check()
If Trim(form1.adminUserid.value)="" Then
alert("用户名称必须填写")
form1.adminUserid.Select
check=False
Exit Function
End If
If Trim(form1.pwd.value)="" Then
alert(&