请教个问题。谢谢了。
<%
Function GetURL(URL)
Set http=Server.CreateObject("Microsoft.XMLHTTP")
On Error Resume Next
http.Open "GET",URL,False
http.send()
if Err then
Err.Clear
Response.Write "<script>alert('没有找到网页,请返回后重试.');location=document.location+'';</script>"
Response.End()
End if
getHTTPPage=bytesToBSTR(Http.responseBody,"gb2312")
set http=nothing
GetURL=getHTTPPage
End Function
'转换编码函数
Function BytesToBstr(body,Cset)
Dim objstream
Set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
If(request("Send")="up") Then
If(request("URLSTR")<>"") Then
Content = GetURL(request("URLSTR"))
If(InstrRev(Content,"http://127.0.0.1")>0) Then '这里就是你网站的网址
Response.Write "<script>alert('可以添加');location='1.html';</script>"
Else
Response.Write "<script>alert('请先在您的首页加上我们的友情连接.');</script>"
End If
End If
End If
%>
<style type="text/css">
<!--
body,td,th,div,span,input,select,textarea,p {
font-family: 微软雅黑;
font-size: 12px;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: none;
color: #000000;
}
a:active {
text-decoration: none;
color: #000000;
}
-->
</style>
<FORM METHOD=POST ACTION="">
<input type=text name="URLSTR"><input type=submit value="检测连接">
<input type=hidden name="Send" value="up">
</FORM>
这是个验证对方网站是否有本站友情链接。上面有个这个代码
If(InstrRev(Content,"http://127.0.0.1")>0) Then '这里就是你网站的网址
Response.Write "<script>alert('可以添加');location='1.html';</script>"
就是对方网站加上http://127.0.0.1链接就能跳转。可是。在检测输入框中直接填写http://127.0.0.1这个网址也能跳转。就是别人不做链接也能打开'1.html'这个页面。
有那位朋友可以添加一个。检测功能。当输入的网址和您的网站地址一样的时候就有提示不能跳转。输入已做链接的网站就可以继续下面的代码。
Function GetURL(URL)
Set http=Server.CreateObject("Microsoft.XMLHTTP")
On Error Resume Next
http.Open "GET",URL,False
http.send()
if Err then
Err.Clear
Response.Write "<script>alert('没有找到网页,请返回后重试.');location=document.location+'';</script>"
Response.End()
End if
getHTTPPage=bytesToBSTR(Http.responseBody,"gb2312")
set http=nothing
GetURL=getHTTPPage
End Function
'转换编码函数
Function BytesToBstr(body,Cset)
Dim objstream
Set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
If(request("Send")="up") Then
If(request("URLSTR")<>"") Then
Content = GetURL(request("URLSTR"))
If(InstrRev(Content,"http://127.0.0.1")>0) Then '这里就是你网站的网址
Response.Write "<script>alert('可以添加');location='1.html';</script>"
Else
Response.Write "<script>alert('请先在您的首页加上我们的友情连接.');</script>"
End If
End If
End If
%>
<style type="text/css">
<!--
body,td,th,div,span,input,select,textarea,p {
font-family: 微软雅黑;
font-size: 12px;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: none;
color: #000000;
}
a:active {
text-decoration: none;
color: #000000;
}
-->
</style>
<FORM METHOD=POST ACTION="">
<input type=text name="URLSTR"><input type=submit value="检测连接">
<input type=hidden name="Send" value="up">
</FORM>
这是个验证对方网站是否有本站友情链接。上面有个这个代码
If(InstrRev(Content,"http://127.0.0.1")>0) Then '这里就是你网站的网址
Response.Write "<script>alert('可以添加');location='1.html';</script>"
就是对方网站加上http://127.0.0.1链接就能跳转。可是。在检测输入框中直接填写http://127.0.0.1这个网址也能跳转。就是别人不做链接也能打开'1.html'这个页面。
有那位朋友可以添加一个。检测功能。当输入的网址和您的网站地址一样的时候就有提示不能跳转。输入已做链接的网站就可以继续下面的代码。
...全文
相关推荐
狱吏问题,求解钱币兑换问题,沙漠问题蛮力算法.pdf
"蛮力法在解决计算机科学中的问题时,通常是指通过尝试所有可能的解决方案来找到正确答案的方法。这种方法虽然简单直接,但效率往往较低,适用于问题规模较小的情况。本资源包含了三个使用蛮力法求解的问题:狱吏
P问题、NP难问题详解
本文将深入探讨P问题、NP问题、NPC问题以及NP难问题的概念及其在计算机科学中的重要性。P问题指的是可以通过多项式时间复杂度算法求解的问题,常见的例子如信息奥赛题目,其特点是解的搜索过程在问题规模增
lingo数学建模 生产安排问题 汽车广告费问题 运输问题与转运问题.ppt
本资料主要涉及了LINGO在生产安排、汽车广告费用以及运输和转运问题中的应用。一、生产安排问题生产安排问题是企业运营中常见的一种优化问题,目标是最大化利润或最小化成本。
旅行商问题(TSP问题)
"旅行商问题(TSP问题)的解决方法,包括穷举策略中的深度优先搜索与回溯法,以及启发式策略中的贪心算法和蚁群算法。"旅行商问题(Traveling Salesman Problem,TSP)是运筹
P问题、NP问题、NP完全问题和NP难问题理解
1.P(polynominal)问题–多项式问题存在多项式时间算法的问题。2.NP(Nondeterministic Polynominal)问题–非确定多项式问题能在多项式时间内验证得出一个正确解的


