
文字,图片连接
,时间,页面地址,等等。反正可以用字段记录的数据
都可以存到数据库的字段当中,实体的就不了,比如图片,文件压缩这些就的存放到服务器硬盘中,提供给数据库调用。
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head>
<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312" />
<title>无标题文档</title>
<!--#include file="inc/css.css"-->
</head>
<!--#include file="inc/connection.asp"-->
<%
dim pgnum,pgsize,pgcount,i,m
pgnum=request("pgnum")
pgsize=request("pgsize")
if pgnum="" then
pgnum=1
else
pgnum=cint(pgnum)
end if
if pgsize="" then
pgsize=15
end if
set rs=server.CreateObject("adodb.recordset")
sql="select * from 管理员信息表 order by 管理员id desc"
rs.open sql,conn,1,1
if rs.eof or rs.bof then
msg="没有管理员信息!"
response.Write "<center><span class=""STYLE1"">" &msg &"</span></center>"
end if
if not rs.eof or not rs.bof then
rs.movefirst
rs.pagesize=pgsize
rs.absolutepage=pgnum
pgcount=rs.pagecount
pgcount=cint(pgcount)
if pgnum >pgcount then
pgnum=1
rs.absolutepage=pgnum
end if
%>
<body>
<form action="editmanage.asp" method="post" name="form1">
<table width="750" border="0" align="center" >
<tr>
<td width="80" height="17" align="left" valign="middle" class="STYLE5">管理员列表</td>
<td width="660" valign="middle">
<hr size="1" align="left" width="80%" color="#CCCCCC" /></td>
</tr>
<tr valign="top" align="center">
<td colspan="2" style="border:1px solid #CCCCCC" height="300" align="center" width="100%">
<table width="100%" border="0" align="center">
<tr>
<td width="100" height="20" align="center" valign="middle" class="STYLE5">管理员ID</td>
<td width="100" align="center" valign="middle" class="STYLE5">管理员名</td>
<td width="120" align="center" valign="middle" class="STYLE5">电子邮件</td>
<td width="80" align="center" valign="middle" class="STYLE5">管理员类别</td>
</tr>
<%
i=0
while not rs.eof and i <pgsize
%>
<tr align=center onmouseover="this.bgColor='#cccccc'" onmouseout="this.bgColor=''" style="border:1px solid #CCCCCC">
<td class="STYLE1"><input name="manage_id" type="radio" value="<%=rs("管理员id")%>"/><%=rs("管理员id")%></td>
<td class="STYLE1"><%=rs("管理员名")%></td>
<td class="STYLE1"><%=rs("管理员email")%></td>
<td class="STYLE1"><%=rs("管理员类别")%></td>
</tr>
<%
rs.movenext
i=i+1
wend
%>
</table>
</td>
</tr>
</table>
<%
end if
rs.close
set rs=nothing
%>
<table width="750" border="0" align="center" >
<tr>
<%if pgcount >0 then%>
<td width="15%" align="left"><span class="STYLE1">当前页<%=pgnum%>/<%=pgcount%></span></td>
<%else%>
<td width="15%" align="left" class="STYLE1">当前页0/0</td>
<%end if%>
<td width="70%" align="right"><a href="managetable.asp?pgnum=1" class="STYLE1">首页</a><span class="STYLE1">|</span>
<%if pgnum >1 then%>
<a href="managetable.asp?pgnum=<%=pgnum-1%>" class="STYLE1">上一页</a>
<%else%>
<font color="#CCCCCC" class="STYLE1">上一页</font>
<%end if%><span class="STYLE1">|</span>
<%if pgnum <pgcount then%>
<a href="managetable.asp?pgnum=<%=pgnum+1%>" class="STYLE1">下一页</a>
<%else%>
<font color="#CCCCCC" class="STYLE1">下一页</font>
<%end if%><span class="STYLE1">|</span> <a href="managetable.asp?pgnum=<%=pgcount%>" class="STYLE1">尾页</a><span class="STYLE1">|</span> <span class="STYLE1">转到第</span>
<select name="sel_pg" onchange="javascript:location=this.options[this.selectedIndex].value" class="STYLE1">
<%for m=1 to pgcount
if m=pgnum then%>
<option value="managetable.asp?pgnum=<%=m%>" selected="selected"><%=m%></option>
<%else%>
<option value="managetable.asp?pgnum=<%=m%>"><%=m%></option>
<%end if
next%>
</select>
<span class="STYLE1">页</span></td>
</tr>
</table>
<table width="750" border="0" align="center">
<tr>
<td height="22" width="469"></td>
<td width="89" align="center" valign="middle"><input name="button1" type="button" id="button1" value=" 添加 ">
<script language="vbscript" for=button1 event=onclick>
window.location.href="addmanage.asp"
</script> </td>
<td width="88" align="center" valign="middle"><input name="submit1" type="submit" id="button2" value=" 修改 "></td>
<td width="86" align="center" valign="middle"><input name="submit2" type="submit" id="button3" value=" 删除 "></td>
</tr>
</table>
</form>
</body>
</html>
带分页~~你把数据库的名字改了~~
connection.asp文件是
<%
set conn=server.CreateObject("adodb.connection")
connstr="driver=server=你的服务器名称UID=saPWD=sadatabase=你的数据库名称"
conn.open connstr
%>
首先你得配置好服务器软件的环境(如apeache,iis)还要有一种变成语言(如JSP,ASP,.net,php等等)
我们DW有一种东西叫服务器行为。
DW CS3下(如果不是CS3.是4或者5,你自己在窗口-服务器行为,来添加)
应用程序->服务器行为
我以php为例子:
单击数据库>加号>mysql连接
然后输入连接名称:(随便给)
mysql服务器:主机地址或者是mysql服务器的地址(如果端口不是默认的,请带上端口号)
用户名:一般是root(看情况)
密码:看情况
数据库:选取(如果连接上了,你可以选择数据库)
然后确定
绑定(就相当于查询)
加号里有:
记录集(查询)
自定义变量:表单变量($_POST),URL变量($_GET)等等(阶段变量是$_SESSION)
其他的没有研究过
服务器行为(正牌货):
插入记录(相当于mysql 的插入,需要前台)
删除记录*(相当于mysql 的删除,就是传递参数删除)
更新记录(需要前台)
登陆用户(用户登陆的功能)
等等。你自己研究把= =这东西不好用,还是自己写代码把
反正我是看透服务器行为了。。。。。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)