if Request.ServerVariables("Request_Method")="POST" thendim title,introduce,contents,NoNo=""title=trim(Request.form("title"))contents = Request.form("contents")contents = Replace(contents,Chr(32)," ")contents = Replace(contents,vbcrlf,"<br>")If Request.form("introduce")="" thenintroduce=InterceptString(contents,390)introduce = introduce + "……"elseintroduce=Rtrim(Request.form("introduce"))End ifdim count,ncontentsncontents=""count=len(contents)for i=1 to countncontents = ncontents + Mid(contents,i,1) + "##"nextncontents=title+"<br><br>"+ncontentsset conn=server.createobject("adodb.connection")conn.open"provider=microsoft.jet.oledb.4.0;data source="&server.mappath("hsxshasp.mdb")set rs=server.createobject("adodb.recordset")sql="select * from hnovels"rs.open sql,conn,1,3rs.addnewrs("title")=titlers("introduce")=introducers("author")=session("user")rs.updateNo=rs("number")rs.closeset rs=nothingset conn=nothingset objFSO=server.createobject("scripting.filesystemobject")ph=server.mappath("ziyuan\"&No&".txt")set fp=objFSO.createtextfile(ph)fp.write ncontentsfp.closeset fp=nothingset objFSO=nothingresponse.write "<p align=center>添加小说成功,<a href=read.asp?id="&No&">查看</a> <a href='index.asp'>返回首页</a></p>"response.end……为什么添加小说时,得出的文件开头会有个逗号(,)的呢?
參考答案:这是一时的疏忽,写错了变量名称或名字,我也我也经常遇到。检查表单