这段代码那儿错了?(作业)

来源:百度知道 编辑:UC知道 时间:2024/05/18 09:09:31
<!--#Include file="conn.asp"-->
<%
if trim(request.form("title"))="" then
%>
<html><head><title>增加</title></head>
<body>
<form name="form1" method="post" action="">
<table width="60%" border="1" align="center" cellpadding="0" cellspacing="0"
bgcolor="#CCCCCC">
<tr>
<td width="19%">学生号</td>
<td width="81%"><input name="studno" type="text" size="50"></td>
</tr>
<tr>
<td>姓名</td>
<td><input name="studname" type="text" size="50"></td>
</tr>
<tr>
<td>身份证号码</td>
<td><input name="idno" type="text" size="50"

不知是大哥还是大姐,你这是什么东西啊?这么多if 就一个endif?不过了你?回去好好看看书。

if studno="" then studno="无内容"
studname=trim(request.form("studname"))
if studname="" then studname="无内容"
idno=trim(request.form("idno"))
if idno="" then idno="无内容"
class=trim(request.form("class"))
if class="" then class="无内容"
setno=trim(request.form("setno"))
if setno="" then setno="无内容"
class
rs.addnew
rs("studno")=studno
rs("studname")=studname
rs("idno")=idno
rs("class")=class
rs("setno")=setno
rs.update
response.Redirect("index.asp")
rs.Close
conn.Close
set rs=nothing
set conn=nothing
end if

第三句
if trim(request.form("title"))="" then
改成
if trim(request.