问题描述
在增加产品页面编辑完内容点保存时提示:行:1char:7错误:无效字符代码:0url:http://localhost/manage/product_add.asp?add=ok增加产品的页面如下:<%@LANGUAGE="VBSCRIPT"CODEPAGE="936"%><!--#includefile="conn.asp"--><!--#includefile="seeion.asp"--><!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml"><head><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/><title><%=site_info("title")%>-后台管理系统</title><scriptlanguage="javascript">functionshowUploadDialog(s_Type,s_Link,s_Thumbnail){vararr=showModalDialog("ewebeditor/dialog/i_upload.htm?style=pcfinal&type="+s_Type+"&link="+s_Link+"&thumbnail="+s_Thumbnail,window,"dialogWidth:0px;dialogHeight:0px;help:no;scroll:no;status:no");}</script><scriptlanguage="javascript"><%SetRs=Server.CreateObject("Adodb.Recordset")Rs.Open"SELECT*FROMproduct_small_classORDERBYsub_idasc",conn,1,1%>varonecount;onecount=0;subcat=newArray();<%i=0DoWhileNotRs.EOF%>subcat[<%=i%>]=newArray("<%=Trim(Rs("sub_title"))%>","<%=Rs("main_id")%>","<%=Rs("sub_id")%>");<%i=i+1Rs.MoveNextLoopRs.Close%>onecount=<%=i%>;functionchangelocation(locationid,formname){formname.sub_id.length=0;varlocationid=locationid;vari;for(i=0;i<onecount;i++){if(subcat[i][1]==locationid){formname.sub_id.options[formname.sub_id.length]=newOption(subcat[i][0],subcat[i][2]);}}}</script><linkhref="css.css"rel="stylesheet"type="text/css"/></head><body><tablewidth="98%"border="0"align="center"cellpadding="0"cellspacing="0"><tr><td><tablewidth="100%"border="0"cellspacing="0"cellpadding="0"><tr><tdwidth="52"><imgsrc="images/main_1.jpg"width="52"height="55"/></td><tdbackground="images/main_2.jpg"class="title1">添加产品</td><tdwidth="52"><imgsrc="images/main_3.jpg"width="52"height="55"/></td></tr></table></td></tr><tr><td><tablewidth="100%"border="0"cellspacing="0"cellpadding="0"><tr><tdwidth="15"background="images/main_4.gif"> </td><tdbackground="images/main_9.gif"><tablewidth="99%"border="0"align="center"cellpadding="0"cellspacing="1"class="table"><formaction="product_add.asp?add=ok"method="post"name="product_add"id="product_add"><tr><thwidth="80"class="td">产品名称:</th><tdclass="td"><inputname="title"type="text"class="input"size="80"/></td></tr><tr><thclass="td">产品分类:</th><tdclass="td"><selectname="main_id"id="main_id"onchange="changelocation(document.product_add.main_id.options[document.product_add.main_id.selectedIndex].value,document.product_add)"><%i=0SetRsBig=Conn.Execute("SELECT*FROMproduct_big_classORDERBYorder_id")DoWhileNotRsBig.EOFIfi=0Thenmain_id=RsBig(0)Response.Write("<optionvalue="""&RsBig(0)&""">"&RsBig(1)&"</option>")i=i+1RsBig.MoveNextLoopSetRsBig=Nothing%></select><selectname="sub_id"id="sub_id"><%Ifmain_id<>""ThenSetRsSmall=Conn.Execute("SELECT*FROMproduct_small_classWHEREmain_id="&main_id)DoWhileNotRsSmall.EOFResponse.Write("<optionvalue="""&RsSmall(0)&""">"&RsSmall(1)&"</option>")RsSmall.MoveNextLoopEndIfSetRsSmall=Nothing%></select></td></tr><tr><thclass="td">产品缩略图:</th><tdclass="td"><inputname="thumbnail"type="text"class="input"size="80"/><inputname="button"type="button"class="button"onclick="showUploadDialog('image','product_add.thumbnail','')"value="上传图片"/></td></tr><tr><thclass="td">产品关键词:</th><tdclass="td"><inputname="keywords"type="text"class="input"size="80"/></td></tr><tr><thclass="td">关键词描述:</th><tdclass="td"><inputname="description"type="text"class="input"size="100"/></td></tr><tr><thclass="td">详细介绍:</th><tdclass="td"><inputtype="hidden"name="body"/><iframeid="eWebEditor1"src="ybb/ewebeditor.asp?id=body&style=77883"frameborder="0"scrolling="No"width="100%"height="350"></iframe></td></tr><tr><thclass="td">产品推荐:</th><tdclass="td"><inputname="recommendatory"type="radio"value="1"/>推荐<inputname="recommendatory"type="radio"checked="checked"value="0"/>不推荐</td></tr><tr><tdclass="td"><pclass="submit"> </p></td><tdclass="td"><spanclass="submit"><inputname="submit"type="submit"class="button"value="确认添加"/></span></td></tr></form></table></td><tdwidth="15"background="images/main_5.gif"> </td></tr></table></td></tr><tr><td><tablewidth="100%"border="0"cellspacing="0"cellpadding="0"><tr><tdwidth="52"><imgsrc="images/main_6.gif"width="52"height="16"/></td><tdbackground="images/main_7.gif"width="100%"></td><tdwidth="52"><imgsrc="images/main_8.gif"width="52"height="16"/></td></tr></table></td></tr></table></body></html><%IfRequest.QueryString("add")="ok"ThenSetrs=server.CreateObject("adodb.recordset")sql="select*fromproduct"rs.Opensql,conn,1,3title=request.Form("title")main_id=request.Form("main_id")sub_id=request.Form("sub_id")thumbnail=request.Form("thumbnail")keywords=request.Form("keywords")Description=request.Form("description")body=request.Form("body")recommendatory=request.Form("recommendatory")Iftitle=""Thenresponse.Write("<scriptlanguage=javascript>alert('标题不能为空!');history.go(-1)</script>")response.EndEndIfIfbody=""Thenresponse.Write("<scriptlanguage=javascript>alert('详细内容不能为空!');history.go(-1)</script>")response.EndEndIfrs.addnewrs("title")=titlers("main_id")=main_idrs("sub_id")=sub_idrs("thumbnail")=thumbnailrs("keywords")=keywordsrs("description")=Descriptionrs("body")=bodyrs("recommendatory")=recommendatoryrs.updaters.CloseSetrs=Nothingconn.CloseSetrs=NothingResponse.Write"<script>alert('添加成功!');window.location.href='product_add.asp';</script>"EndIf%>
解决方案
解决方案二:
那位兄弟帮忙看下阿?
解决方案三:
看不出问题,或许你的包含文件有错.
解决方案四:
BODY是文本编辑区,手工输入没问题可以保存成功,但是复制网页后就提示错误
解决方案五:
把出错的地方标示一下。
解决方案六:
另外,lz可以先打印SQL语句看看。有可能有所帮助。
解决方案七:
rs("body")=bodybody是文本编辑区,手工输入没问题可以保存成功,但是复制网页后就提示错误
解决方案八:
建议你下次提问时将的你字体带颜色,错误信息的地方来点提示,
解决方案九:
从网页复制后粘贴到文本区保存时提示错误