Message posted the 11/02/2009 by JDutrey
Vérification de la présence d'un lien sur une autre page avec le composant AspHttp:
<%
Server.ScriptTimeout = 240 Set HttpObj = Server.CreateObject("AspHTTP.Conn") HttpObj.Url = ""&url_back&"" 'HttpObj.Port = 80 'HttpObj.TimeOut = 80 HttpObj.RequestMethod = "GET" HttpObj.UserAgent = "Mozilla/2.0 (compatible; MSIE 3.0B; Windows NT)" strResult = HttpObj.GetURL 'Response.Write "<h2>A HREF List</h2>" varHREFArray = HttpObj.GetHREFs intHREFArrayLimit = UBound(varHREFArray) -1 For I = 0 to intHREFArrayLimit if varHREFArray(I) = "http://"&request.ServerVariables("SERVER_NAME") then url_check = url_check+1 end if 'Response.Write varHREFArray(I) & "<br>" & VBCrLF Next
if url_check<1 then Response.Redirect "page_reponse.html" else
'Action à réaliser puisqu'il a trouvé le lien
end if
%>
|