hvorfor virker følgende script ikke?
<%On Error Resume Next'**
'* A List Apart - The Perfect 404
'* http://alistapart.com/articles/perfect404/
'*
'* Original Author : Ian Lloyd (Javascript)
'* Modified by : Andrew Waer (PHP)
'* Rewritten by : Ed Knittel (ASP)
'* Last Modified : 01-28-2004
'*
'* Basically just an ASP conversion of Andrew's PHP script from Ian's Javascript
'* With some extras
'**
Dim strReferer
strReferer = LCase(Request.ServerVariables("HTTP_REFERER"))
strURL = LCase(Request.ServerVariables("QUERY_STRING"))
blnSearchReferral = False
blnInsiteReferral = False
'strError = "404"
strSite = ""
If Len(strReferer)<>0 Then
'We have been referred to this page some another web page ...
If (InStr(1,strReferer,".looksmart.co") > 0) OR (InStr(1,strReferer,".ifind.freeserve") > 0) OR (InStr(1,strReferer,".ask.co") > 0) OR (InStr(1,strReferer,"google.co") > 0) OR (InStr(1,strReferer,"altavista.co") > 0) OR (InStr(1,strReferer,"msn.co") > 0) OR (InStr(1,strReferer,"hotbot.co") > 0) OR (InStr(1,strReferer,"yahoo.co") > 0) Then
'we have been referred to from a known search engine
blnSearchReferral = True
arrSite = Split(strReferer,"/")
arrParams = Split(strReferer,"?")
strSearchTerms = arrParams(1)
arrParams = Split(strSearchTerms,"&")
strSite = arrSite(2)
sQryStr = ""
' Define what search terms are in use
' Be sure to Dim the array length appropriately
Dim arrQueryStrings(4)
arrQueryStrings(0) = "q=" //google, altavista, msn
arrQueryStrings(1) = "p=" //yahoo
arrQueryStrings(2) = "ask=" //ask jeeves
arrQueryStrings(3) = "qt=" //looksmart
arrQueryStrings(4) = "query=" //hotbot
Dim i,q
For i=0 To UBound(arrParams)
'loop through all the parameters in the referring page's URL
For q=0 To UBound(arrQueryStrings)
sQryStr = arrQueryStrings(q)
If (InStr(1,arrParams(i),sQryStr)) Then
'we've found a search term!
strSearchTerms2 = Split(strSearchTerms,sQryStr)
strSearchTerms = strSearchTerms2(1)
strSearchTerms = Replace(strSearchTerms,"+"," ")
End If
Next
Next
'strSite
'strReferer
Response.Write "Du søgte efter" & strSearchTerms & "<br>"
end if
end if%>
