关于缺少语句
大家好!我是一个刚学ASP编程的新手,有个文件代码一直不明白为什么会出问题,希望大家能够帮帮我!config/function.inc.asp是:
<%
sub msgboxU(str)
response.Write("<script language=vbscript>msgbox "&chr(34)&str&chr(34)&"</script>")
end sub
%>
config/db.asp是:
<%
dim conn,dbpath
set conn=Server.CreateObject("adodb.connection")
dbpath="/db/"
conn.open "ERIVER=Driver do Microsoft Access (*.mdb);DBQ="&Server.MapPath(dbpath & "fifasp.mdb")
%>
/reguser.asp是:
<% Option Explicit %>
<!--#include file="config/db.asp"-->
<!--#include file="config/function.inc.asp"-->
<html>
<head>
<title>用户注册</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style type="text/css">
<!--
body {
background-color: #CCCCCC;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
body,td,th {
font-size: 12px;
}
.STYLE1 {color: #FF0000}
-->
</style></head>
<body>
<%
on error resume next
dim sql,rst
if request.querystring("act")="reg" then
if request.form("f_user")="" or request.form("f_code")="" then msboxU"用户名和密码都需要填写!"
else
set rst=server.createobject("adodb.recordset")
sql="select count(*) as recnum from tbl_user where u_user='"&request.form("f_user")&"'"
rst.open sql,conn,1,1
if rst("recnum")>0 then
msboxU"已经存在同名用户!"
else
sql="insert into tbl_user (u_user,u_code,u_name,u_sex,u_tel) values ('"&request.form("f_user")&"','"&request.form("f_code") & "','" & request.Form("f_name") & "','" & request.Form("f_sex") & "','" & request.Form("f_tel") & "')"
conn.execute sql
set myErrors=conn.errors
if myErrors.count=0 then
msgboxU"注册成功!"
else
msboxU"注册失败! 原因:"&myErrors.item(0).description
end if
end if
rst.close
set rst=nothing
end if
end if
%>
<!-- ImageReady Slices (fenye_02.psd) -->
<table width="791" border="0" align="center" cellpadding="0" cellspacing="0" id="__01">
<tr>
<td rowspan="3"><img id="index_top_01" src="images/index_top_01.jpg" width="1" height="188" alt="" /></td>
<td rowspan="3"><img id="index_top_02" src="images/index_top_02.jpg" width="280" height="188" alt="" /></td>
<td colspan="7"><img id="index_top_03" src="images/index_top_03.jpg" width="510" height="21" alt="" /></td>
</tr>
<tr>
<td><img id="index_top_04" src="images/index_top_04.jpg" width="59" height="29" alt="" /></td>
<td><img id="index_top_05" src="images/index_top_05.jpg" width="83" height="29" alt="" /></td>
<td><img id="index_top_06" src="images/index_top_06.jpg" width="92" height="29" alt="" /></td>
<td><img id="index_top_07" src="images/index_top_07.jpg" width="71" height="29" alt="" /></td>
<td><img id="index_top_08" src="images/index_top_08.jpg" width="95" height="29" alt="" /></td>
<td><img id="index_top_09" src="images/index_top_09.jpg" width="85" height="29" alt="" /></td>
<td><img id="index_top_10" src="images/index_top_10.jpg" width="25" height="29" alt="" /></td>
</tr>
<tr>
<td colspan="7"><img id="index_top_11" src="images/index_top_11.jpg" width="510" height="138" alt="" /></td>
</tr>
</table>
<table width="791" border="0" align="center" cellpadding="0" cellspacing="0" id="__01">
<tr>
<td colspan="3">
<img id="fenye_02_01" src="images/fenye_02_01.jpg" width="791" height="14" alt="" /></td>
</tr>
<tr>
<td>
<img id="fenye_02_02" src="images/fenye_02_02.jpg" width="14" height="254" alt="" /></td>
<td width="768" height="254" valign="top" background="images/fenye_02_03.jpg"><br />
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center">这里是标题</div></td>
</tr>
<tr>
<td><img src="images/fenye_02_xian.jpg" width="750" height="3" /></td>
</tr>
<tr>
<td><form id="form1" name="form1" method="post" action="reguser.asp?act=reg">
<table width="434" height="185" border="1" align="center">
<tr>
<td colspan="2"><div align="center">用户注册</div></td>
</tr>
<tr>
<td width="111"><div align="center">用户名:</div></td>
<td width="307"><label>
<input type="text" name="f_user" id="f_user" />
<span class="STYLE1">*</span></label></td>
</tr>
<tr>
<td><div align="center">密??码:</div></td>
<td><label>
<input type="password" name="f_code" id="f_code" />
<span class="STYLE1">*</span> </label></td>
</tr>
<tr>
<td><div align="center">姓??名:</div></td>
<td><label>
<input type="text" name="f_name" id="f_name"/>
</label></td>
</tr>
<tr>
<td><div align="center">性??别:</div></td>
<td><label>
<input name="f_sex" type="radio" value="男" checked="checked" />
男
<input type="radio" name="f_sex" value="女" />
女</label></td>
</tr>
<tr>
<td><div align="center">电??话:</div></td>
<td><label>
<input type="text" name="f_tel" id="f_tel"/>
</label></td>
</tr>
<tr>
<td colspan="2"><label>
<div align="center">
<input type="submit" name="Submit" value="提交" />
??????
<input type="reset" name="Submit2" value="重置" />
</div>
</label></td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td><img src="images/fenye_02_xian.jpg" width="750" height="3" /></td>
</tr>
<tr>
<td>?</td>
</tr>
</table></td>
<td>
<img id="fenye_02_04" src="images/fenye_02_04.jpg" width="9" height="254" alt="" /></td>
</tr>
<tr>
<td colspan="3">
<img id="fenye_02_05" src="images/fenye_02_05.jpg" width="791" height="7" alt="" /></td>
</tr>
</table>
<table width="791" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="791" height="92" background="images/fenye_down.jpg">?</td>
</tr>
</table>
<!-- End ImageReady Slices -->
<%
conn.close
set conn=nothing
%>
</body>
</html>
[[it] 本帖最后由 sunwukong28 于 2008-2-7 15:56 编辑 [/it]]