烈火网(LieHuo.Net)教程 我做了个会员投稿的,会员在填写完投稿信息时怎样提交到后台呢?
这个投稿的表单我做好了,可是上面的一些定义什么的我不会写,表的名字是Tougao,表里有E_id,E_Title,E_Content3个字段 后台管理能看到的页面为gao.asp请教大家应该怎么写?
回答如下:
显示别人投稿的标题。 tougao.asp:
<!--#include file="conn.asp" -->
<%
s_keyword = trim(request("keyword"))
if s_keyword<>"" then
href="&keyword="&s_keyword
end if
%>
<%dim pmcount,pageno
'//设置新闻显示数量
pmcount=bol_back_count
dim rs,sql
set rs=server.createobject("adodb.recordset")
if request("flag")="del" then
selid=trim(request("selid"))
conn.execute("delete from usertable where id in ("&selid&")")
end if
%>
<html>
<head>
<title>管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body leftmargin="0" topmargin="0">
<table width="100%" border="0" align="center" cellspacing="3" cellpadding="3" bgcolor="#FFFFFF">
<tr>
<td valign="top" nowrap>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="Table2" bgcolor="#799AE1">
<tr>
<form action=user.asp method=post name="toGetbolList" id="toGetbolList">
<td width="86%" height="30" align=left valign="middle"> 搜索:
<input name="keyword" type=text value="<%=s_keyword%>" class="button1">
<input type="submit" name="Submit" value=" 搜 索 " class="button2">
</td></form>
<td width="14%" align="left" valign="middle">
<input name=reloadPage type=button value=" 刷 新 " id="reloadPage" onClick="javascript:window.location.reload();" class="button2"></td>
</tr>
</table>
<table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolordark="#FFFFFF" bordercolorlight="#CCCCCC"><form name="frmgd" method="post" action="">
<tr align="center" bgcolor="#799AE1">
<td width="5%" bgcolor="#799AE1"><font color="#FFFFFF">选择</font></td>
<td width="9%" height="20" bgcolor="#799AE1"><font color="#FFFFFF">E_id</font></td>
<td width="29%" bgcolor="#799AE1"><font color="#FFFFFF">E_Title</font></td>
<td width="57%" height="20" bgcolor="#799AE1"><font color="#FFFFFF">E_Content</font></td>
</tr>
<%
sql="select * from Tougao"
if s_keyword<>"" then
sql=sql&" where s_keyword like '%"&s_keyword&"%'"
end if
sql=sql&" order by E_id desc "
rs.open sql,conn,1,3
rcount=rs.recordcount
if pmcount="" or isempty(pmcount) or pmcount<1 then
pmcount=20
end if
rs.pagesize=pmcount '设置每页数
mpage=rs.pagecount '得到总页数
pageno=request("pageno")
if pageno="" then
pageno=1
end if
if isempty(pageno) or cint(pageno)<1 or cint(pageno)>mpage then
pageno=1
end if
if rs.bof and rs.eof then
response.write "<tr><td colspan='7'><div align='center'>没有信息</div></td></tr>"
else
rs.absolutepage=pageno '将指针移至指定页的第一条记录
loopno=pmcount
i=1
do while not rs.eof and loopno>0%>
<tr onMouseover=this.style.backgroundColor='#DCECF4'; onMouseout=this.style.backgroundColor=''>
<td width="5%" align="center"> <input name="selid" type="checkbox" id="selid" value="<%=rs("id")%>"></td>
<td height="11" align="center"><%=rs("E_id")%></td>
<td><a href="info.asp?id=<%=rs("E_id")%>" target="_blank"><%=rs("E_Title")%></a></td>
<td ><%=left(rs("E_Content"),20)%></td>
<%rs.movenext
loopno=loopno-1
i=i+1
loop
end if %>
</tr>
<tr>
<td height="11" colspan="4">
<input name="selall" type="checkbox" id="selall" >
<input name="del" type="button" id="del" value="删除" onClick="chklistfrm('del','')">
<input name="flag" type="hidden" id="flag"></td>
</tr>
<%
rs.close
set rs=Nothing
%></form>
</table>
<table width="100%" border="0" cellspacing="2" cellpadding="2" class=buinput>
<tr>
<form name="Form1" method="post" action="?keyword=<%=s_keyword%>">
<td align="right">
<%if cint(pageno)>1 then%>
[<a href='user.asp?keyword=<%=s_keyword%>&pageno=<%=pageno-1%>&sort=<%=sortid%>'>上一页</a>]
<%end if
if cint(pageno)<cint(mpage) then
%>
[<a href='user.asp?keyword=<%=s_keyword%>&pageno=<%=pageno+1%>&sort=<%=sortid%>'>下一页</a>]
<%end if%>
共<%=cstr(pageno)&"/"&cstr(mpage)&"页 "&cstr(rcount)%>条资讯
<input type='text' name='pageno' size=2 maxlength=10 value="<%=page%>" align="center" onKeyPress= "onlyNumberText()">
<input name="submit" type='submit' class="button" value='Goto' size=2></td>
</form>
</tr>
</table>
</td>
</tr>
</table>
</html>
零七网部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与零七网进行文章共享合作。