www.gusucode.com > 超文本多用户论坛程序 1.1 > bbs/admin/ljxg.asp

    <!--#include file="hs.asp"-->
<%
id=request("id")
sql="select * from zwlike where ltbh='"&ltbh&"'"
set rs=conn.execute(sql)
if request("act")=empty then
%>
<body topmargin=50%>
<form action="ljxg.asp?act=true&id=<%=rs("id")%>" method=post>
<div align="center">
<table cellpadding="0" cellspacing="0" width="348" style="border: 1px solid #3399FF" height="268" align=center>
	<tr>
		<td height="36" bgcolor="#F1F5FA" style="border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px" colspan="2">
		<font color="#FF0000"><span style="font-size: 12px">&nbsp;连接名称:<input type="text" name="ljmc" size="20" value="<%=rs("ljmc")%>"> 
		*</span></font></td>
	</tr>
	<tr>
		<td height="36" width="93" bgcolor="#F1F5FA">
		<p align="left"><span style="font-size: 12px"><font color="#FF0000">&nbsp;连接url:</font></span></td>
		<td height="36" width="253" bgcolor="#F1F5FA">
		<font color="#FF0000"><span style="font-size: 12px">
		<input type="text" name="ljril" size="20" value="<%=rs("ljril")%>"> *</span></font></td>
	</tr>
	<tr>
		<td height="34" width="93" bgcolor="#F1F5FA">
		<span style="font-size: 12px"><font color="#FF0000">&nbsp;连接logo:</font></span></td>
		<td height="34" width="253" bgcolor="#F1F5FA">
		<font color="#FF0000"><span style="font-size: 12px">
		<input type="text" name="ljlogo" size="20" value="<%=rs("ljlogo")%>"></span></font></td>
	</tr>
	<tr>
		<td height="139" width="93" bgcolor="#F1F5FA">
		<span style="font-size: 12px"><font color="#FF0000">&nbsp;连接说明:</font></span></td>
		<td height="139" width="253" bgcolor="#F1F5FA">
		<span style="font-size: 12px"><font color="#FF0000">
		<textarea rows="6" name="ljsm" cols="38" style="color: #FF0000; font-size: 12px"><%=rs("ljsm")%></textarea></font></span></td>
	</tr>
	<tr>
		<td height="21" colspan="2" bgcolor="#F1F5FA">
		<p align="center"><input type="submit" value="提 交" name="B1">
		<input type="reset" value="重 置" name="B2"></td>
	</tr>
</table>
</div>
</form>
</body>
<%
rs.close
set rs=nothing
else

'修改代码
function ReplaceBadChar(strChar)
	if strChar="" then
		ReplaceBadChar=""
	else
		ReplaceBadChar=replace(replace(replace(replace(replace(replace(replace(strChar,"'",""),"*",""),"?",""),"(",""),")",""),"<",""),".","")
	end if
end function

Function url(strng) 
url = false 
Dim regEx, Match 
Set regEx = New RegExp 
regEx.Pattern = "^[a-zA-z]+://(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$" 
regEx.IgnoreCase = True 
Set Match = regEx.Execute(strng) 
if match.count then url= true 
End Function 

id=request("id")
ljmc=ReplaceBadChar(request("ljmc"))
ljril=trim(request("ljril"))
ljlogo=trim(request("ljlogo"))
ljlogo=replace(ljlogo,"'","")
ljsm=ReplaceBadChar(request("ljsm"))

if ljmc=empty or ljril=empty then
response.write"<script language=vbscript>window.alert""连接名称和连接url不能为空!""</script>"
response.write"<script language=vbscript>window.location=""ljxg.asp""</script>"
response.end
end if

if ljril<>empty then
if url(ljril)<>true then
response.write"<script language=vbscript>window.alert""连接url不正确!""</script>"
response.write"<script language=vbscript>window.location=""ljxg.asp""</script>"
response.end
end if
end if

sqlxg="update zwlike set ljmc='"&ljmc&"',ljril='"&ljril&"',ljlogo='"&ljlogo&"',ljsm='"&ljsm&"'where id="&id&" and ltbh='"&ltbh&"'"
conn.execute(sqlxg)
%>
<script language=vbscript>
<!--
window.alert"连接修改成功!"
window.close
-->
</script>
<%
dbclose
end if
%>