?? add_link.asp
字號:
<!--#include file="conn.asp"-->
<!--#include file="../function.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style type="text/css">
<!--
.STYLE1 {
color: #653E1D;
font-weight: bold;
font-size: 22px;
}
.STYLE4 {font-size: 22px}
.STYLE11 {color: #000099; font-weight: bold; font-size: 18px; }
.menu1 {color: #0000CC; font-weight:bold; font-size:12px; text-align:left; padding-top:2px; padding-left:5px;}
.menutitle{ }
img{
padding-top:2px;}
a:link {
color: #009933;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #5298E4;
}
a:hover {
color: #000000;
}
-->
</style>
</head>
<body>
<%
if session("msmax")="" then
response.Redirect("login.asp")
end if
%>
<%
dim page_no
'page_no=request.QueryString("page_no"))
if request.QueryString("page_no")="" then
page_no=1
else
page_no=cint(request.QueryString("page_no"))
end if
%>
<%
edit=request.QueryString("edit")
linkid=request.QueryString("linkid")
session("linkid")=linkid
if edit="true" then
'dim linkrs,strsql
set linkrs=server.CreateObject("adodb.recordset")
strsql="select * from link where id="&linkid
linkrs.open strsql,db,1
%>
<form id="form1" name="form1" method="post" action="link_action.asp?edit=true" >
<span class="STYLE1"><a href="
<input name="href" type="text" id="href" value="<%=linkrs("URL")%>" size="30" maxlength="50" />
">
<label>
<input name="text" type="text" id="text" size="20" value=<%=linkrs("text")%> />
</label>
</a></span><span class="STYLE4"> </span>
<input type="submit" name="Submit" value="修改鏈接" />
</form>
<%else%>
<form id="form1" name="form1" method="post" action="link_action.asp" >
<span class="STYLE1"><a href="
<input name="href" type="text" id="href" value="http://" size="30" maxlength="50" />
">
<label>
<input name="text" type="text" id="text" size="20" />
</label>
</a></span><span class="STYLE4"> </span>
<input type="submit" name="Submit" value="添加鏈接" />
</form>
<%end if%>
<table width="100%" border="2" cellpadding="5" cellspacing="5" bordercolor="#009900" bordercolordark="#99FF66" bordercolorlight="#FF6633">
<tr>
<td width="8%" bgcolor="#FF9933"><span class="STYLE11">id</span></td>
<td width="38%" bgcolor="#FF9933"><span class="STYLE11">鏈接網(wǎng)址</span></td>
<td width="19%" bgcolor="#FF9933" class="STYLE11">描述</td>
<td colspan="2" bgcolor="#FF9933"><div align="center" class="STYLE11">編輯</div></td>
</tr>
<%
dim linkrs,strsql
set linkrs=server.CreateObject("adodb.recordset")
strsql="select * from link order by id desc"
linkrs.open strsql,db,1
if not linkrs.bof and not linkrs.eof then
linkrs.pagesize=pagesize
dim page_total
page_total=linkrs.pageCount
linkrs.absolutepage=page_no
dim i
i=10
do while not linkrs.eof and i>0
i=i-1
%>
<tr>
<td bgcolor="#FFC184"><%=linkrs("id")%></td>
<td bgcolor="#FFC184"><a href="<%=linkrs("URL")%>" target="_blank"><%=linkrs("URL")%></a></td>
<td bgcolor="#FFC184"><a href="<%=linkrs("URL")%>" target="_blank"><%=linkrs("text")%></a></td>
<td width="18%" bgcolor="#FFC184"><div align="center"><a href="link_del.asp?id=<%=linkrs("id")%>">刪除</a></div></td>
<td width="17%" bgcolor="#FFC184"><div align="center"><a href="add_link.asp?linkid=<%=linkrs("id")%>&edit=true">修改</a></div></td>
</tr>
<%
linkrs.movenext
loop
end if
linkrs.close
set db=nothing
%></table>
<div align="center">
<%
'--------------------------------------------------------------------------------------
'這一段輸出頁數(shù)信息。Page_total由上面分頁顯示決定。
Response.Write "<p align='center'><b><font color='#CC0066'>" & page_no & "/" & page_total & "</b></font>頁 "
'顯示往前10頁的鏈接,為當前最小值減1
Dim numTemp
numTemp=minPage(page_no,page_total)-1
If numTemp>=1 Then
Response.Write "<a href='add_link.asp?page_no=" & numTemp & "'>前10頁</a> "
End If
'顯示當前10頁的鏈接
For I=minPage(page_no,page_total) To maxPage(page_no,page_total)
If I=page_no Then
Response.Write "<b><font color='#CC0066'>" & I & "</font></b> "
Else
Response.Write "<a href='add_link.asp?page_no=" & I & "'>" & I & "</a> "
End If
Next
'顯示往后10頁的鏈接,為當前最大值加1
numTemp=maxPage(page_no,page_total)+1
If numTemp<page_total Then
Response.Write "<a href='add_link.asp?page_no=" & numTemp & "'>后10頁</a> "
End If
%>
</div>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -