我的这个asp文件是从asp300下载的 吻雪文章管理系统。我加了activeform后,发现部分代码不执行了 从strtype() 开始(我做了标记)。同时我做的 按钮 “就用这段了” 也没有反应?
还有pihome要我写的settext()我写在inc/ubbcode.js文件中了。
这是为什么?
全部的addarticle.asp如下:
望高手们再辛苦看看。
<!--#include file="conn.asp"-->
<!--#include file="top.asp"-->
<!--#include file="connst.asp"-->
<!--#include file="inc/function.asp"-->
<!--#include file="config.asp"-->
<!--#include file="usercookies.asp"-->
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
<LINK href="inc/kissSnow.css" type=text/css rel=stylesheet>
</head>
<body>
<%
call getcookies()
if ckUserLogin then
call kissSnow_error()
else
if request("action")="save" then
call saveadd()
if founderr then call kissSnow_error()
else
call top()
call add()
call foot()
end if
end if
sub add()
%>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" class=tab>
<tr>
<td width="100%" > </td>
</tr>
<tr>
<td width="100%" >
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" class=t2>
<tr>
<td width="100%" bgcolor="#FEFEEE">
<img border="0" src="images/dgbt.gif" align="right">请务必认真阅读<%=webname%><b>《投稿须知》</b>,若有任何疑问,请来信yfzhou@sina.com
,发信前请先查阅《访问<%=webname%>常见问题》&nbsp;&nbsp; 第一次投稿请查看<b>排版说明</b>。</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" > </td>
</tr>
</table>
<script src="inc/ubbcode.js"></script>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" class=tab>
<form method="POST" action="addarticle.asp?action=save" name=frmAnnounce >
<tr class=t2>
<td width="23%" align="right"><b>作者:</b></td>
<td width="77%"><%=username%></td>
</tr>
<tr class=t2>
<td width="23%" align="right"><b>文章标题:</b></td>
<td width="77%"><input type="text" name="title" size="30"></td>
</tr>
<tr class=t2>
<td width="23%" align="right"><b>副标题:</b></td>
<td width="77%"><input type="text" name="title1" size="43"></td>
</tr>
<tr >
<td width="23%" align="right"> </td>
<td width="77%">
</td>
</tr>
<tr class=t2>
<td width="23%" align="right"><b>授权级别:</b></td>
<td width="77%"><b><input type="radio" value="1" name="empower" checked></b>一级<b><input type="radio" value="2" name="empower"></b>二级<b><input type="radio" value="3" name="empower"></b>三级</td>
</tr>
<tr class=t2>
<td width="23%" align="right"><b>文章类型:</b></td>
<td width="77%">
<b><%call strtype()%></b></td>
</tr>
<tr class=t2>
<td width="23%" align="right"><b>背景音乐:</b></td>
<td width="77%">
<select size="1" name="midi">
<option value="no" selected>无音乐</option>
<option value="tmm">甜蜜蜜</option>
<option value="xzfyz">相知风雨中</option>
<option value="zxzygys">真心真意过一生</option>
<option value="zxyx">真心英雄</option>
<option value="zdan">真的爱你</option>
<option value="rwhxrwy">让我欢喜让我忧</option>
<option value="yd">雨蝶</option>
<option value="wenbie">吻别</option>
<option value="dyrcj">但愿人长久</option>
<option value="anzys">爱你这样傻</option>
<option value="zhufu">祝福</option>
<option value="yishengsuoai">一生所爱</option>
</select> 试听</td>
</tr>
<tr class=t2>
<td width="23%" align="right"><b>简介: </b></td>
<td width="77%">
<b><input type="text" name="about" size="60"></b></td>
</tr>
<% if kissSnowCode=1 then %>
<tr class=t2>
<td width="23%" align="right"> </td>
<td width="77%"><!--#include file="inc/getubb.asp"--></td>
</tr>
<% end if %>
<tr class=t2>
<td width="23%" valign="top">
<p align="right"><b>文章内容:</b></td>
<td width="77%">
<textarea rows="19" name="Content" cols="80" onkeydown=ctlent() wrap=VIRTUAL ></textarea>
<br>
<object
classid="clsid:1C726B54-D3E0-4832-BFBE-8EE9CAAFECD3"
codebase="http://BRAIN/mywebs/ewrite/myrefer/AX_Refer.ocx#version=1,0,0,0"
width=640
height=250
align=center
hspace=0
vspace=0
id="ActiveXForm"
>
<param name="myUserID" value=<%=GroupID%>>
<param name="myUserPassWD" value=<%=UserName%>>
</object>
</td>
</tr>
<tr class=t2>
<td width="23%" align="right">保密性 </td>
<td width="77%">
<div align="left">
<input type="radio" name="showitcbtn" value="1">
公开
<input type="radio" name="showitcbtn" value="0" checked>
保密
<input type="Button" name="myButton" value="就使用这段" onclick=SetText()>
</div></td>
</tr>
<tr class=t2>
<td width="23%" align="right"> </td>
<td width="77%"> </td>
</tr>
<tr class=t2>
<td width="100%" align="right" colspan="2">
<p align="center"><input type="submit" value="提交" name="B1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" value="重置" name="B2"></td>
</tr>
<tr class=t2>
<td width="23%" align="right"> </td>
<td width="77%">
<p align="center"> </td>
</tr>
</form>
</table>
<%end sub
sub add2()
end sub
sub strtype() //没有执行????????
dim i
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from type where oradd=1 order by rootid,orders "
rs.open sql,conn,1,1
if not rs.eof then
%>
<select name="typeid" >
<option selected value="00" >选择分类</option>
<%do while not rs.eof %>
<option value="<%=rs("typeid")%>">
<%if rs("depth")>0 then%>
<% for i=1 to rs("depth") %>&nbsp;<%next
%>├<%end if%><%=trim(rs("typename"))%></option>
<%
rs.movenext
loop
%>
</select>
<%
end if
rs.close
set rs=nothing
end sub
sub saveadd()
dim typeid,title1,midi,empower,showit
dim content,title,about,contLen
dim postIP,rst,articleid
postIP=Request.ServerVariables("REMOTE_ADDR")
content=Request.Form("content")
content=htmlencode(content)
title=Checkstr(trim(request.Form("title")))
title1=Checkstr(trim(request.Form("title1")))
about=Checkstr(Request.Form("about"))
typeid=Trim(Request.Form("typeid"))
midi=Checkstr(Trim(Request.Form("midi")))
empower=clng(Checkstr(trim(request.Form("empower"))))
showit=clng(Checkstr(trim(request.Form("showitcbtn")))) '/*add new
contLen=clng(strLength(content))
if title="" or about="" then
Errmsg=Errmsg+"<br>"+"<li>您没有填写文章标题,或者文章简介,或者您没有选择文章类型。"
founderr=true
exit sub
end if
if typeid="" then
Errmsg=Errmsg+"<br>"+"<li>您没有选择文章类型。"
founderr=true
exit sub
end if
if strLength(title)>20 then
ErrMsg=ErrMsg+"<Br>"+"<li>主题目长度不能超过20字符。"
FoundErr=True
exit sub
end if
if strLength(title1)>40 then
ErrMsg=ErrMsg+"<Br>"+"<li>幅标题长度不能超过40字符。"
FoundErr=True
exit sub
end if
if content="" then
Errmsg=Errmsg+"<br>"+"<li>您没有填写文章内容。"
founderr=true
exit sub
end if
'################
if chkpost=false then
ErrMsg=ErrMsg+"<Br>"+"<li>您提交的数据不合法,请不要从外部提交发言。"
FoundErr=True
exit sub
end if
'#########判断外部发言!
if username="" or password="" then
ErrMsg=ErrMsg+"<Br>"+"<li>您没有登陆或者您登陆时间超时,请重新登陆。"
FoundErr=True
exit sub
end if
set rs=server.createobject("adodb.recordset")
sql="select title.userid,title.username,title.title,title.about,title.typeid,title.empower,title.showit,title.useTable,title.date,title.contentLen,title.strlevel from [title] "
rs.open sql,conn,1,3
'if not rs.eof and not rs.bof then
rs.addNew
rs("userid")=userid
rs("username")=username
rs("title")=title
rs("about")=about
rs("typeid")=typeid
rs("empower")=empower
rs("showit")=showit
rs("useTable")=useTable
rs("date")=now()
rs("contentLen")=contLen
if orpass<>1 then
rs("strlevel")=1
end if
rs.update
rs.close
set rst=conn.execute("select max(id) from title ")
articleid=rst(0)
'##########插入title表
set rs=server.createobject("adodb.recordset")
sql="select * from "&useTable
rs.open sql,conn,1,3
rs.addNew
rs("articleid")=articleid
rs("userid")=userid
rs("username")=username
rs("title")=title
rs("title1")=title1
rs("content")=content
rs("date")=now()
rs("typeid")=typeid
rs("empower")=empower
rs("showit")=showit
rs("midi")=midi
rs("postIP")=postIP
rs.update
rs.close
'#######插入content表
'sql="update [user] set article=article+1 where userid="&UserID
'set rsU=conn.execute(sql)
'#########更新用户文章(不随着发表文章更新,使用审核后更新)
'sql="update [config1] set ArticleNum=ArticleNum+1 "
'set rsc=conn.execute(sql)
'##更新文章数目,不随发表增长,审核后增长
set rs=nothing
rst.close
set rst=nothing
conn.close
set conn=nothing
%>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" class=t3>
<tr>
<td width="100%"> </td>
</tr>
<tr>
<td width="100%" align="center"> </td>
</tr>
<tr>
<td width="100%" align="center"> </td>
</tr>
<tr>
<td width="100%" align="center"><b>文章保存成功!请等待审核!</b></td>
</tr>
<tr>
<td width="100%" align="center"><a href="userhome.asp">◎返回家园</a></td>
</tr>
<tr>
<td width="100%" align="center"><a href="index.asp">◎返回首页</a></td>
</tr>
</table>
<%end sub%>
</body>
</html>