📄 setfriend.asp
字号:
<%
''''''''''''''''''''''''''''''''''''''''''''
'
' TXSite / 通用网站系统
'
' 版本 :v1.8.20
'
' 制作人 :milp(milp@21cn.com)
'
' 版权所有:源码之家(http://www.21tx.com)
'
' 主页地址:http://www.21tx.com
' http://www.bestnets.net
' http://www.soucn.com
'
' 技术支持:http://www.21tx.com/bbs
'
''''''''''''''''''''''''''''''''''''''''''''
'程序创建时间:12:19 2001-8-6
'程序完成时间:13:11 2001-8-6
'最后修改时间:14:17 2001-8-7
if session("adminflag")="" then Response.Redirect "default.asp"
dim action,id,name,url,click,isUse
action=request("action")
const thisprog="setfriend.asp"
dim sqlfenye,txtitle
txtitle=request("searchtxt")
if txtitle<>"" then
sqlfenye="select * from friendsite where name like '%"&trim(txtitle)&"%' order by id desc"
else
sqlfenye="select * from friendsite order by id desc"
end if
Sub deleteid(id)
conn.execute "delete from friendsite where id="&cstr(id)
End sub
Sub isUseid(id)
if session("adminflag")>2 then PrintMsg(NotAdmin)
conn.execute "update friendsite set isUse=True where id="&cstr(id)
End Sub
Sub notisUseid(id)
if session("adminflag")>2 then PrintMsg(NotAdmin)
conn.execute "update friendsite set isUse=False where id="&cstr(id)
End Sub
%>
<!--#include file=base.asp-->
<!--#include file=subs.asp-->
<%
if session("adminflag")>2 then Call PrintMsg(NotAdmin)
if action="" then action="add"
if action="saveadd" or action="savemod" then
Call savefriend
elseif action="fenye" then
Call fenye
elseif action="mod" then
Call modfriend
else
Call addfriend
end if
%>
<!--#include file=end.asp-->
<%Sub modfriend
rSub.open "select * from friendsite where id="&request("id"),conn,1,1
if rSub.bof and rSub.eof then Call PringMsg("操作错误!")
id=rSub("id")
name=rSub("name")
url=rSub("url")
click=rSub("click")
isUse=rSub("isUse")
rSub.close
Call addfriend
End Sub%>
<%Sub addfriend%>
<br><p align=center><font color=red><b><%=request("msg")%></b></font></p>
<form method="POST" action="<%=thisprog%>?action=save<%=action%>&id=<%=id%>">
<table width="40%" border="0" cellspacing="2" cellpadding="2" align="center">
<tr align="center">
<td colspan="2">友情链接管理</td>
</tr>
<tr>
<td width="50%"">站点名称:</td>
<td width="50%">
<input type="text" name="name" class="smallInput" value="<%=name%>">
</td>
</tr>
<tr>
<td width="50%"">主页地址:</td>
<td width="50%">
<input type="text" name="url" class="smallInput" value="<%=url%>">
</td>
</tr>
<tr>
<td width="50%"">是否显示:</td>
<td width="50%">
<%if name="" then%>
<input type="checkbox" name="isUse" checked>
<%else%>
<input type="checkbox" name="isUse" value="<%=isUse%>" <%if isUse then response.write "checked"%>>
<%end if%>
</td>
</tr>
<tr>
<td width="50%"">点 击:</td>
<td width="50%">
<input type="text" name="click" class="smallInput" value="<%=click%>">
</td>
</tr>
<tr align="center">
<td colspan="2">
<input type="submit" value=" 确 定 ">
<input type="reset" value=" 重 置 ">
</td>
</tr>
</table>
</form>
<p>说明<br><br>是否显示:是否在首页中显示<br>点击:新增请输入初始值,如果为空自动置为 1
<%End Sub
Sub savefriend
name=trim(request.form("name"))
isUse=trim(request.form("isUse"))
click=trim(request.form("click"))
url=trim(request.form("url"))
if name="" then
OutMsg=OutMsg+"<br>"+"<li>错误提示:请输入站点名!"
founderr=true
end if
if url="" then
OutMsg=OutMsg+"<br>"+"<li>错误提示:请输入站点链接!"
founderr=true
end if
if founderr=true then Call PrintMsg(OutMsg)
if action="saveadd" then
rSub.open "select * from friendsite where id is null",conn,1,3
rSub.AddNew
elseif action="savemod" then
rSub.open "select * from friendsite where id="&request("id"),conn,1,3
end if
rSub("name")=name
if click<>"" then
rSub("click")=click
else
rSub("click")=1
end if
if isUse="" then
rSub("isUse")=False
else
rSub("isUse")=True
end if
rSub("url")=url
rSub.Update
id=rSub("id")
rSub.Close
response.redirect ""&thisprog&"?action=mod&id="&id&"&msg=操作成功!"
End Sub%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -