| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 384 人关注过本帖
标题:后台上传内容出错
只看楼主 加入收藏
jjj123w
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2008-7-2
结帖率:0
收藏
 问题点数:0 回复次数:1 
后台上传内容出错
请各位大侠帮忙看下的,

后台上传图片文字这些内容就没有错误,如果在源代码中添加一行<SCRIPT src="http://chat. type=text/javascript></SCRIPT>
  
图片附件: 游客没有浏览图片的权限,请 登录注册

2010-7-22 10:09
如果以后要修改的时候就会出错,
   
图片附件: 游客没有浏览图片的权限,请 登录注册


2010-7-22 10:09
里面没有内容,
最低下就一行这个       edithtm.document.body.innerHTML=SHTML;
MYWEB.rar (4.94 KB)


<%@ language="vbscript"%>
<!--#INCLUDE File="string.asp"--><!--#include file="conn.asp"-->
<!--#include file="pass.asp"--><%
response.Expires = 0%>
<%

if request("news")="update" then session("idh")=""
l=0
%>


<%set rs3=server.createobject("adodb.recordset")
set rs=server.createobject("adodb.recordset")
sql="select * from newlb "
rs.open sql,conn,1,1
if request("news")="" then
              session("idh")=request("id")
if request("id")<>"" then
              session("hpc1")=request("id")

set rs_detail=server.createobject("adodb.recordset")

sqltext2="select * from news where id=" & request("id")
rs_detail.open sqltext2,conn,1,1
'if rs_detail.bof then
'格式化公司简介网页形式为文本格式
if not rs_detail.eof then
       nr=rs_detail("nr")
    bt=rs_detail("bt")
    oth=rs_detail("oth")
    oth2=rs_detail("oth2")
    oth3=rs_detail("oth3")
    sm=rs_detail("sm")
       riqi=rs_detail("riqi")
       mytype=rs_detail("mytype")
              mytype2=rs_detail("mytype2")
       edithtm=rs_detail("nr")
       PIC=rs_detail("PIC")
if nr<>"" then
nr=replace(nr,chr(13)+chr(10),"")
          nr=replace(nr,chr(34),"\"&chr(34))
end if
end if
'p_about=replace(p_about,"“","""")
'p_about=replace(p_about,"“","'")
'p_about=replace(p_about,"&nbsp;&nbsp;"," ")
'p_about=replace(p_about,"<br>",vbCrLf)
'p_about=Request("edithtm")
'格式化企业动态网页形式为文本格式
'shop_lm2=rs_detail("shop_lm2")
end if
else
       set rs1=server.createobject("adodb.recordset")
       sqltext="select * from NEWS order by id desc"
       rs1.open sqltext,conn,1,1
       if not rs1.eof then
              session("hpc1")=rs1("id")+1
'              session("idh")=rs1("id")+1
       else
              session("hpc1")=1
'              session("idh")=1
       end if
       RS1.CLOSE
       nr=""
    bt=""
       riqi=date
       mytype=""
       mytype2=""
       edithtm=""

'set rs_detail=server.createobject("adodb.recordset")
'sqltext2="select * from class_4 where idh=" & request("idh")
'rs_detail.open sqltext2,conn,1,3
'if rs_detail.eof then
'       rs_detail.addnew
'       rs_detail("shop_lm2")=""
'       rs_detail("shop_name1")=request.cookies("sp_name")
'       rs_detail("idh")=trim(request("idh"))
'       rs_detail.update
'       l=1
'end if      
'nr=rs_detail("nr")
'edithtm=rs_detail("nr")
'shop_lm2=rs_detail("shop_lm2")
'if nr<>"" then
'nr=replace(nr,chr(13)+chr(10),"")
'          nr=replace(nr,chr(34),"\"&chr(34))
'         end if
end if
%>
<html>
<head>
<title>新闻管理</title>

<STYLE>BODY {
       FONT-SIZE: 10pt
}
TD {
       FONT-SIZE: 10pt; LINE-HEIGHT: 150%
}
A {
       TEXT-DECORATION: none
}
A:hover {
       TEXT-DECORATION: underline
}
.blueone {
       CURSOR: move; FILTER: blur(add=ture,direction=80,strength=10); WIDTH: 550px;FILTER: glow(color=blue,strength=10);FONT-SIZE: 20pt;color:#FFFFFF;LINE-HEIGHT: 200%
}

      

</STYLE>
<script language="javascript">
<!--
function isok(theform)
{

if (theform.P_about.value.length<1)

  {
    alert("公司简介若要为空请用两个空格符代替!");
    theform.P_about.focus();
    return (false);
  }

if (theform.Enterprises.value.length<1)

  {
    alert("企业动态若要为空请用两个空格符代替!");
    theform.Enterprises.focus();
    return (false);
  }

if (theform.Cooperate.value.length<1)

  {
    alert("合作代理若要为空请用两个空格符代替!");
    theform.Cooperate.focus();
    return (false);
  }

if (theform.Recruitment.value.length<1)

  {
    alert("诚聘英才若要为空请用两个空格符代替!");
    theform.Recruitment.focus();
    return (false);
  }

return (true);
}
-->
</script><script language="JavaScript">
var bLoad=false
var pureText=true
var bTextMode=false
function MM_ck()
{
var text = frames.edithtm.document.body.innerText;
var html = frames.edithtm.document.body.innerHTML;
document.frmdate.edithtm.value=html;
}
   public_description=new Editor

function Editor() {
  this.put_html=SetHtml;
  this.get_html=GetHtml;
}

function GetHtml() {
  if (bTextMode)
    return edithtm.document.body.innerText
  else {
    cleanHtml();
    cleanHtml();
    return edithtm.document.body.innerHTML;
  }
}

function public_SetMyHtml(sVal) {
  if (bTextMode)
    edithtm.document.body.innerText=sVal
  else
    edithtm.document.body.innerHTML=sVal
}

function SetHtml(sVal) {
  if (bTextMode)
    edithtm.document.body.innerText=sVal
  else
    edithtm.document.body.innerHTML=sVal
}
function MM_mouse(sl,cl)
{
       sl.className=cl;
}
</script>
<script language="JavaScript1.2" src="js/edithtm.js"></script>
<script language="javascript">
<!--
function the_form()
{ validity = true;
       var text = frames.edithtm.document.body.innerText;
var html = frames.edithtm.document.body.innerHTML;
document.frmdate.edithtm.value=html;
  return validity;
}
function MM_openwin(url,childname,config)
{
    window.open(url,childname,config);
}
//-->
</script>


</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onLoad="javascript:MM_load();">

<table width="778" border="0" cellspacing="0" cellpadding="0" align="center" height="1" bgcolor="#CCCCCC">
  <tr>
    <td></td>
  </tr>
</table>
<table width="778" border="0" cellspacing="0" cellpadding="0" align="center" height="414">
  <tr>
    <td width="1" bgcolor="#CCCCCC" height="414"></td>
    <td width="100%" height="414" background="../pic/user/bg.jpg" valign="top">
      <script language="JavaScript1.2" src="js/showborder.js"></script>
      <form action="update_myweb.asp" method="POST" name="frmdate" id="frmdate"  onSubmit="return the_form();" >
        <table width="99%" border="1" align="center" cellpadding="2" cellspacing="1" bordercolor="#FFFFFF"  bgcolor="#007db5">
          <tr>
            <td width="544" height="20" colspan="2" bordercolor="#007db5" bgcolor="#007db5" >
              <div align="center"><font color="#FFFFFF">新闻
                <%if request("news")="update" then %>
                添加
                <%else%>
                修改
                <%end if%>
                </font></div></td>
          </tr>
          <tr>
            <td height="39" colspan="2" bgcolor="#FFFFFF" > <div align="left">标题:
                <% 'if trim(rs_detail("shop_lm2"))<>"" then %>
                <input name="bt" type="text" id="bt" value="<%=bt%>" size="60">
                <%'end if%>
                <input name="id" type="hidden" id="id" value="<%=session("idh")%>" size="10" checked>
                <input name="idh" type="hidden" id="idh" value="<%'=rs_detail("idh")%>" size="10" checked>
              </div></td>
          </tr>
          <tr>
            <td height="39" colspan="2" bgcolor="#FFFFFF" >类别:
              <select name="mytype" id="select">
                <%do while not rs.eof
                            %>
                <option value="<%=rs(1)&":0"%>" <%if rs(1)=mytype then response.write "selected"%>><%=rs(1)%></option>
                <% sql3="select * from newslb2 where idh="&rs(0)
rs3.open sql3,conn,1,3
if not rs3.eof then
do while not rs3.eof%>
                <option value="<%=rs(1)&":"&rs3(2)%>" <%if rs(1)=mytype and rs3(2)=mytype2  then response.write "selected"%>>&nbsp;&nbsp;<%=rs3(2)%></option>
                <%
rs3.movenext
loop
end if
rs3.close %>
                <%
                              rs.movenext
                              loop%>
              </select>
              日期:
              <input name="riqi" type="text" id="riqi" value="<%=riqi%>" size="10">
              <select name="oth" id="oth">
                <option value="" <%if oth="" then response.write "selected"%>>新闻类别</option>
                <option value="1"<%if oth="1" then response.write "selected"%>>非新闻类别</option>
              </select>
                                     <select name="oth2" id="oth2">
                <option value="" <%if oth2="" then response.write "selected"%>>考试动态</option>
                <option value="1"<%if oth2="1" then response.write "selected"%>>非考试动态</option>
              </select>               <select name="oth3" id="oth3">
                <option value="" <%if oth3="" then response.write "selected"%>>公告、通知 </option>
                <option value="1"<%if oth3="1" then response.write "selected"%>>非公告、通知</option>
              </select>  </td>
          </tr>
          <tr>
            <td height="39" bgcolor="#FFFFFF" ><input name="pic" type="hidden" value="<%=pic%>" size="52" >
              <iframe marginwidth=0 framespacing=0 marginheight=0 frameborder=0 width='420' height=40 srcolling=no src="upload1.asp">
              </iframe> </td>
            <td bgcolor="#FFFFFF" >附件说明:
              <input name="sm" type="text" id="sm" value="<%=sm%>"><a href="<%=pic%>"><%=sm%></a></td>
          </tr>
          <tr>
            <td height="93" colspan="2" align="right" valign="top" bgcolor="#FFFFFF">
              <div align="center"> </div>
              <table border="0" cellspacing="0" cellpadding="0" width="100%" class="csl" onMouseOver="borderize_on(event)" onMouseOut="borderize_off(event)">
                <tr>
                  <td width="10"> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#999999">
                      <tr bgcolor="#FFFFFF" class="cls">
                        <td width="3"></td>
                        <td> <div style="width: 2px; border: 2px inset"></div></td>
                      </tr>
                    </table></td>
                  <td width="128" bgcolor="#FFFFFF"> <select id="FontName"  title="字体名" language="javascript" onChange="format('fontname',this[this.selectedIndex].value);" name="select">
                      <option class="heading">字体</option>
                      <option value="宋体">宋体</option>
                      <option value="黑体">黑体</option>
                      <option value="楷体_GB2312">楷体</option>
                      <option value="仿宋_GB2312">仿宋</option>
                      <option value="MS Song">MS宋体</option>
                      <option value="MS Hei">MS黑体</option>
                      <option value="MingLiU">MingLiU</option>
                      <option value="Arial">Arial</option>
                      <option value="Arial Black">Arial Black</option>
                      <option value="Arial Narrow">Arial Narrow</option>
                      <option value="Bradley Hand ITC">Bradley Hand ITC</option>
                      <option value="Brush Script MT">Brush Script MT</option>
                      <option value="Century Gothic">Century Gothic</option>
                      <option value="Comic Sans MS">Comic Sans MS</option>
                      <option value="Courier">Courier</option>
                      <option value="Courier New">Courier New</option>
                      <option value="MS Sans Serif">MS Sans Serif</option>
                      <option value="Script">Script</option>
                      <option value="System">System</option>
                      <option value="Times New Roman">Times New Roman</option>
                      <option value="Viner Hand ITC">Viner Hand ITC</option>
                      <option value="Verdana">Verdana</option>
                      <option value="Wide Latin">Wide Latin</option>
                      <option value="Wingdings">Wingdings</option>
                    </select> </td>
                  <td width="56" bgcolor="#FFFFFF"> <select id="FontSize"  title="字号大小" language="javascript" onChange="format('fontsize',this[this.selectedIndex].value);" name="select">
                      <option class="heading">字号</option>
                      <option value="1">一号</option>
                      <option value="2">二号</option>
                      <option value="3">三号</option>
                      <option value="4">四号</option>
                      <option value="5">五号</option>
                      <option value="6">六号</option>
                      <option value="7">七号</option>
                      <option value="-1">-1</option>
                      <option value="+1">+1</option>
                    </select> </td>
                  <td width="56" bgcolor="#FFFFFF"> <select id="ForeColor"  title="字体色彩" language="javascript" onChange="format('forecolor',this[this.selectedIndex].value);" name="select">
                      <option class="heading">字色</option>
                      <option value="red" style="background='red'">红色</option>
                      <option value="blue" style="background='blue'">蓝色</option>
                      <option value="green" style="background='green'">绿色</option>
                      <option value="yellow" style="background='yellow'">黄色</option>
                      <option value="pink" style="background='pink'">粉红</option>
                      <option value="cyan" style="background='cyan'">天青</option>
                      <option value="white" style="background='white'">白色</option>
                      <option value="darkred" style="background='darkred'">深红</option>
                      <option value="darkblue" style="background='darkblue'">深蓝</option>
                      <option value="darkgreen" style="background='darkgreen'">深绿</option>
                      <option value="darkyellow" style="background='darkyellow'">土黄</option>
                      <option value="darkcyan" style="background='darkcyan'">蓝绿</option>
                      <option value="gray" style="background='gray'">浅灰</option>
                      <option value="black" style="background='black'">黑色</option>
                    </select> </td>
                  <td width="22" bgcolor="#FFFFFF" class="menulines" style="CURSOR: hand"><img src="img/fontcolor.gif" width="22" height="20" onClick="foreColor();" alt="字色"></td>
                  <td width="74" bgcolor="#FFFFFF"> <select id="BackColor" title="字体背景色彩" language="javascript" onChange="format('backcolor',this[this.selectedIndex].value);" name="select">
                      <option class="heading">背景色
                      <option value="red" style="background='red'">红色
                      <option value="blue" style="background='blue'">蓝色
                      <option value="green" style="background='green'">绿色
                      <option value="yellow"style="background='yellow'">黄色
                      <option value="pink" style="background='pink'">粉红
                      <option value="cyan" style="background='cyan'">天青
                      <option value="white" style="background='white'">白色
                      <option value="darkred" style="background='darkred'">深红
                      <option value="darkblue" style="background='darkblue'">深蓝
                      <option value="darkgreen" style="background='darkgreen'">深绿
                      <option value="darkyellow" style="background='darkyellow'">土黄
                      <option value="darkcyan" style="background='darkcyan'">蓝绿
                      <option value="gray" style="background='gray'">浅灰
                      <option value="black" style="background='black'">黑色 </select>
                  </td>
                  <td width="22" bgcolor="#FFFFFF" class="menulines" style="CURSOR: hand"><img src="img/bgcolor.gif" width="22" height="22" onClick="backColor();" alt="背景色"></td>
                  <td width="14" bgcolor="#FFFFFF"> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#999999">
                      <tr class="cls">
                        <td></td>
                        <td> <div style="width: 2px; border: 2px inset"></div></td>
                      </tr>
                    </table></td>
                  <td width="22" bgcolor="#FFFFFF" class="menulines" style="CURSOR: hand"><img src="img/bold.gif" width="22" height="22" language="javascript" border="0" alt="加粗" onClick="format('bold');"></td>
                  <td width="22" bgcolor="#FFFFFF" class="menulines" style="CURSOR: hand"><img src="img/italic.gif" width="22" height="22" language="javascript" border="0" alt="斜体" onClick="format('italic')"></td>
                  <td width="22" bgcolor="#FFFFFF" class="menulines" style="CURSOR: hand"><img src="img/under.gif" width="22" height="22" language="javascript" border="0" alt="下划线" onClick="format('underline')"></td>
                  <td width="300" bgcolor="#FFFFFF">&nbsp;</td>
                </tr>
              </table>
              <table width="100%" border="0" cellspacing="0" cellpadding="0" onMouseOver="borderize_on(event)" onMouseOut="borderize_off(event)" class="csl">
                <tr>
                  <td> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#999999">
                      <tr class="cls">
                        <td width="3"></td>
                        <td> <div style="width: 2px; border: 2px inset"></div></td>
                      </tr>
                    </table></td>
                  <td width="22" class="menulines" style="CURSOR: hand"><img src="img/wlink.gif" width="22" height="22" language="javascript" border="0" alt="插入超级连接" onClick="createLink()"></td>
                  <td width="11" class="menulines" style="CURSOR: hand"><img src="img/img.gif" width="22" height="22" language="javascript" border="0" alt="插入图片" onClick="createImage()"></td>
                  <td width="11" class="menulines" style="CURSOR: hand"><img src="img/table.gif" width="22" height="22" onClick="javascript:addTable()" border="0" alt="插入表格"></td>
                  <td width="11" class="menulines" style="CURSOR: hand"><img src="img/undo.gif" width="22" height="22" onClick="format('undo')" border="0" alt="撤消"></td>
                  <td width="22" class="menulines" style="CURSOR: hand"><img src="img/redo.gif" width="22" height="22" border="0" onClick="format('redo')" alt="重复"></td>
                  <td width="22" class="menulines" style="CURSOR: hand"><img src="img/cut.gif" width="22" height="22" language="javascript" border="0" alt="剪切" onClick="format('cut')"></td>
                  <td width="22" class="menulines" style="CURSOR: hand"><img src="img/copy.gif" width="22" height="22" language="javascript" border="0" alt="复制" onClick="format('copy')"></td>
                  <td width="22" class="menulines" style="CURSOR: hand"><img src="img/paste.gif" width="22" height="22" language="javascript" border="0" alt="粘贴" onClick="format('paste')"></td>
                  <td> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#999999">
                      <tr class="cls">
                        <td width="3"></td>
                        <td> <div style="width: 2px; border: 2px inset"></div></td>
                      </tr>
                    </table></td>
                  <td width="22" class="menulines" style="CURSOR: hand"><img src="img/aleft.gif" width="22" height="22" language="javascript" border="0" alt="左对齐" onClick="format('justifyleft')"></td>
                  <td width="22" class="menulines" style="CURSOR: hand"><img src="img/center.gif" width="22" height="22" language="javascript" border="0" alt="居中" onClick="format('justifycenter')"></td>
                  <td width="22" class="menulines" style="CURSOR: hand"><img src="img/aright.gif" width="22" height="22" language="javascript" border="0" alt="右对齐" onClick="format('justifyright')"></td>
                  <td> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#999999">
                      <tr class="cls">
                        <td width="3"></td>
                        <td> <div style="width: 2px; border: 2px inset"></div></td>
                      </tr>
                    </table></td>
                  <td width="22" class="menulines" style="CURSOR: hand"><img src="img/nlist.gif" width="22" height="22" language="javascript" border="0" alt="数字编号" onClick="format('insertorderedlist')"></td>
                  <td width="22" class="menulines" style="CURSOR: hand"><img src="img/blist.gif" width="22" height="22" language="javascript" border="0" alt="项目编号" onClick="format('insertunorderedlist')"></td>
                  <td> <table border="0" cellspacing="0" cellpadding="0" bgcolor="#999999">
                      <tr class="cls">
                        <td width="3"></td>
                        <td> <div style="width: 2px; border: 2px inset"></div></td>
                      </tr>
                    </table></td>
                  <td width="22" class="menulines" style="CURSOR: hand"><img src="img/ileft.gif" width="22" height="22" language="javascript" border="0" alt="减少缩进量" onClick="format('outdent')"></td>
                  <td width="22" class="menulines" style="CURSOR: hand"><img src="img/iright.gif" width="22" height="22" language="javascript" border="0" alt="增加缩进量" onClick="format('indent')"></td>
                  <td width="350"> <label for="get" style="cursor:hand">
                    <input type=checkbox id="get" name="switchMode" language="javascript" onClick="setMode(switchMode.checked);" value="ON">
                    查看HTML源文件
                    <input type="hidden" name="imgs">
                    <input type="hidden" name="imgid">
                    </label></td>
                </tr>
              </table>
              <iframe name="edithtm" id="edithtm" width="100%" height="350"></iframe>
              <textarea name="edithtm" style="display: none;" rows="1"></textarea></td>
          </tr>
        </table>
        <div align="center"> <br>
          <input type="submit" value="<%if request("news")="update" then
                response.write "增 加"
                else
                response.write "修 改"
                end if%>" name="B4" >
          &nbsp;&nbsp;
          <input name="add22" type="reset" id="add22" value="返 回" onClick="javascript:window.location.href='NEWS.asp';">
        </div>
      </form></td>
  </tr>
</table>
</body>
</html>
<%  
if request("news")="" then
rs_detail.close  
conn.close  
end if
%><script language="JavaScript">                           
    <!--
       var bodyTag="<html><head></head><BODY MONOSPACE STYLE=\"font:10pt 宋体,arial,sans-serif\" leftmargin=\"2\" topmargin=\"2\" marginwidth=\"0\" marginheight=\"0\"></body></html>";
       edithtm.document.write(bodyTag);
       var editControl = frames.edithtm.document;                           
    editControl.designMode = "On";
    frames.edithtm.focus();      
    // -->                           
</script>   
<script language="javascript">
    function MM_load()
{
        var SHTML="<% =nr %>";
       edithtm.document.body.innerHTML=SHTML;
      
}              
</script>

[ 本帖最后由 jjj123w 于 2010-7-22 14:58 编辑 ]
搜索更多相关主题的帖子: 后台 
2010-07-22 14:48
gupiao175
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:40
帖 子:1787
专家分:7527
注 册:2007-6-27
收藏
得分:0 
最近公司IIS不行,无法帮你测试,帮顶了。

Q:1428196631,百度:开发地 即可找到我,有事请留言!
2010-07-22 17:26
快速回复:后台上传内容出错
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028411 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved