求助:“在线编辑器”中的“内容”如何保存到“数据库”中?

求助:“在线编辑器”中的“内容”如何保存到“数据库”中?,第1张

<INPUT type="hidden" name="content1" value="">

<IFRAME ID="eWebEditor1" SRC="edit/ewebeditor.asp?id=content1&style=system" FRAMEBORDER="0" SCROLLING="no" WIDTH="550" HEIGHT="350"></IFRAME>

input隐藏字段content1,与之对应:

edit/ewebeditor.asp?id=content&style=system中的

id要和input中的名字相同,也为content1

那么,提交后提取内容就用

Request("content1") 就可以了。

src 是你的“ewebeditor”文件夹实际的路径,style是样式,可以有多种选择

给你借鉴一下,新闻发布:

News_add.asp页面代码

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">

<tr>

<td align="center" valign="top">

<table width="95%" border="0" cellpadding="2" cellspacing="1" class="table_southidc">

<form method="POST" name="myform" onSubmit="return CheckForm()" action="News_save.asp?action=Add" target="_self">

<tr align="center">

<td class="back_southidc" height="30" colspan="2"><font color="#0000FF"><strong>新增新闻</strong></font></td>

</tr>

<tr bgcolor="#ECF5FF">

<td width="20%" height="24" align="right"><div align="left"><font color="#FF0000">*</font>新

闻标题:</div></td>

<td width="80%" valign="top">

<div align="left">

<input name="title" type="text" class="input" value="" size="50" maxlength="200">

</div></td>

</tr>

<tr bgcolor="#ECF5FF">

<td height="24" align="right"><div align="left"><font color="#FF0000">*</font>新闻类别:</div></td>

<td valign="top">

新闻大类:

<%

set rs= Server.CreateObject("ADODB.Recordset")

sql = "select * from BigClass_New"

rs.open sql,conn,1,1

if rs.eof and rs.bof then

response.write "请先添加栏目。"

else

%>

<select name="BigClassName" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)" size="1">

<option selected value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option>

<%

dim selclass

selclass=rs("BigClassName")

rs.movenext

do while not rs.eof

%>

<option value="<%=trim(rs("BigClassName"))%>"><%=trim(rs("BigClassName"))%></option>

<%

rs.movenext

loop

end if

rs.close

%>

</select>

<select name="SmallClassName">

<option value="" selected>不指定小类</option>

<%

set rs= Server.CreateObject("ADODB.Recordset")

sql="select * from SmallClass_New where BigClassName='" &selclass &"'"

rs.open sql,conn,1,1

if not(rs.eof and rs.bof) then

%>

<option value="<%=rs("SmallClassName")%>"><%=rs("SmallClassName")%></option>

<% rs.movenext

do while not rs.eof%>

<option value="<%=rs("SmallClassName")%>"><%=rs("SmallClassName")%></option>

<%

rs.movenext

loop

end if

rs.close

%>

</select>

</td>

</tr>

<tr bgcolor="#ECF5FF">

<td align="right" valign="top"><div align="left"><font color="#FF0000">*</font>新闻内容:</div></td>

<td valign="top">

<input type="hidden" name="content" value="">

<iframe ID="eWebEditor1" src="Southidceditor/ewebeditor.asp?id=content&style=southidc" frameborder="0" scrolling="no" width="620" HEIGHT="405"></iframe>

</td>

</tr>

<tr bgcolor="#ECF5FF">

<td height="24" align="right"><div align="left">首页图片:

<input name="IncludePic" type="hidden" id="IncludePic" value="yes">

</div></td>

<td valign="top"><input name="DefaultPicUrl" type="text" id="DefaultPicUrl" value="" size="50" maxlength="200">

</td>

</tr>

<tr bgcolor="#ECF5FF">

<td height="24" align="right"><div align="left"><font color="#FF0000">*</font>发布人:</div></td>

<td valign="top">

<div align="left">

<input name="user" type="text" class="input" size="30" value="admin">

</div></td>

</tr>

<tr bgcolor="#ECF5FF">

<td height="24" align="right"><div align="left">首页图片新闻:</div></td>

<td>

<div align="left">

<input type="radio" value="true" name="OK">

<input type="radio" value="false" checked name="Ok">

否 <font color="#FF0000">(设为首页图片新闻,选择此项时请注意文章中是否添加有图片!)</font></div></td>

</tr>

<tr align="center" bgcolor="#ECF5FF">

<td height="35"><div align="left">录入时间:</div></td>

<td height="35"><div align="left">

<input name="AddDate" type="text" id="AddDate" value="<%=date()%>" maxlength="50">

</div></td>

</tr>

<tr align="center" bgcolor="#ECF5FF">

<input type="hidden" name="Id" value="108">

<td height="35" colspan="2"><input type="submit" name="Submit" value="提交" class="input">

<input type="reset" name="Submit" value="重置" class="input"></td>

</tr>

</form>

</table>

</tr>

</table>

<table width="100%" height="28" border="0" cellpadding="0" cellspacing="0" class="HeaderTdStyle">

<tr>

<td>

<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="2">

<tr>

<td align="right">Design By <a href="mailto:[email protected]">ZXKJ</a></td>

</tr>

</table></td>

</tr>

</table>

处理页面News_save.asp代码:

<!--#include file="conn.asp"-->

<%

if Request.QueryString("action")="Add" then

set rs= Server.CreateObject("ADODB.Recordset")

sql="select * from News"

rs.open sql,conn,1,3

If request.form("Title")="" Then

Response.Write("<script language=""JavaScript"">alert(""错误:您没输入标题,请返回检查!!"")history.go(-1)</script>")

response.end

end if

If request.form("content")="" Then

Response.Write("<script language=""JavaScript"">alert(""错误:您没输入新闻内容,请返回检查!!"")history.go(-1)</script>")

response.end

end if

If request.form("user")="" Then

Response.Write("<script language=""JavaScript"">alert(""错误:您没输入发布人,请返回检查!!"")history.go(-1)</script>")

response.end

end if

rs.addnew

rs("Title")=request.form("Title")

rs("Content")=request.form("content")

rs("BigClassName")=request.form("BigClassName")

rs("SmallClassName")=request.form("SmallClassName")

rs("FirstImageName")=request.form("DefaultPicUrl")

rs("User")=request.form("user")

rs("AddDate")=request.form("AddDate")

rs("Ok")=request.form("Ok")

rs.update

rs.close

set rs=nothing

response.Redirect "News_Manage.asp"

end if

%>


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/10056239.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-04
下一篇 2023-05-04

发表评论

登录后才能评论

评论列表(0条)

保存