<% '****************************************************************' ' Food Script .asp version version 4.03062700 ' ' Copyright (C) 1997,1998,1999,2000 Beyond Engineering ' ' All Rights Reserved ' ' Resale and distribution strictly prohibited ' ' Note: Users of this script must have a purchase agreement on ' ' file with Beyond Engineering. ' ' Food Script is a trademark of Beyond Engineering ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' ' SETUP ' ' You will need to modify this section to fit your settings ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'SPECIFY THE DIRECTORY THAT THE TEMPLATE FILES ARE AT ' 'You will need the trailing "\" ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' TemplatePath = "W:\clients\affund\grants\food\" IPpath = "w:\clients\IPSfile\" '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'PAGE ASSIGNMENTS. THESE FILES MUST BE IN THE PATH INDICATED ' 'PREVIOUSLY BY 'TemplatePath' ABOVE. ' '************************* NOTE *****************************' 'IF A PAGE ASSIGNMENT IS A WEB ADDRESS STARTING WITH "HTTP:" ' 'THEN THE SCRIPT WILL PERFORM A REDIRECT INSTEAD ' 'YOU WOULD USE THIS FEATURE IF YOU WANTED TO REDIRECT NORMAL ' 'BROWSERS TO AN ASP PAGE FOR PROCESSING. ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Normal_Page = "funding-frm.asp" Generic_Page = "funding-frm.asp" AltaVista_Page = "funding-1.html" DirectHit_Page = "funding-2.html" Excite_Page = "funding-3.html" HotBot_Page = "funding-4.html" Infoseek_Page = "funding-1.html" Lycos_Page = "funding-5.html" NLSearch_Page = "funding-6.html" Google_Page = "funding-7.html" Fast_Page = "funding-8.html" IPFile= "seo-ips.txt" '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 'DETERMINE IF YOU WANT TO ACTIVATE BROWSER DETECTION OR NOT ' 'DetectBrowsers = FALSE 'Do not detect browsers (For Testing)' 'DetectBrowsers = TRUE 'Detect Browsers (When Live) ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' DetectBrowsers = TRUE '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' ' END SETUP ' ' You will not need to change anything beyond this point. ' '****************************************************************' '****************************************************************' ' ' ' MAIN PROGRAM - DO NOT MODIFY! ' ' ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' SET fso = CreateObject("Scripting.FileSystemObject") GoOn = TRUE IF NOT DetectBrowsers THEN '# bypass browser checking '# assign generic FoodFile just IN case FoodFile = generic_page ELSEIF LEN(TRIM(Request.ServerVariables("HTTP_VIA")&Request.ServerVariables("HTTP_REFERER"))) > 0 THEN '# this is definitely NOT a search engine robot - proxy check check_engine=99 redirect() GoOn = FALSE ELSEIF InStr(UCase(Request.ServerVariables("HTTP_CONNECTION")),"ALIVE") > 0 and NOT InStr(Request.ServerVariables("HTTP_FROM"),"@") > 0 THEN '# this is NOT search engine robot - check FOR Ultraseek spoof check_engine=99 redirect() GoOn = FALSE ELSEIF InStr(UCase(Request.ServerVariables("HTTP_PRAGMA")),"NO-CACHE") > 0 and NOT InStr(Request.ServerVariables("HTTP_FROM"),"@") > 0 THEN '# this is NOT search engine robot - check FOR Ultraseek spoof check_engine=99 redirect() GoOn = FALSE '# added to check for go translator ELSEIF InStr(UCase(Request.ServerVariables("HTTP_RANGE")),"BYTES") > 0 THEN '# this is NOT search engine robot - check FOR Ultraseek spoof check_engine=99 redirect() GoOn = FALSE '# end go translator check ELSE '# assign generic FoodFile just IN case FoodFile=generic_page END IF IF GoOn THEN IF fso.FileExists(IPpath & IPFile) THEN SET ReadIPFile = fso.OpenTextFile(IPpath & IPFile,1,0) DIM engines REDIM engines(0) count = 0 DO UNTIL ReadIPFile.AtENDOfStream engines(count) = ReadIPFile.Readline count = count + 1 REDIM Preserve engines(count) LOOP ReadIPFile.Close check_url() redirect() ELSE msg = "

Cannot open file for reading!


" Response.Write(msg) END IF END IF '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' ' END MAIN PROGRAM ' ' ' '****************************************************************' '****************************************************************' ' ' ' FUNCTIONS ' ' ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' SUB check_url IF LEN(Trim(Request.ServerVariables("REMOTE_ADDR"))) > 0 THEN FOR EACH member IN engines IF LEN(TRIM(member)) > 0 THEN 'DETERMINE IF IP ADDRESS IN FILE IS SPECIFIC OR A RANGE TEMP = TRIM(MID(member,InStrRev(member,":")+1)) 'GRAB THE REMOTE_ADDR RemAddr = Request.ServerVariables("REMOTE_ADDR") 'IF THERE'S A WILDCARD If InStr(Temp,"*")>0 then 'THEN GRAB THE PART BEFORE THE WILDCARD Temp = Left(Temp, InStr(Temp,"*")-1) 'AND ONLY COMPARE THE PARTIAL ADDRESS RemAddr = LEFT(RemAddr,LEN(TEMP)) End If if RemAddr = Temp Then check_engine = 1 IF InStr(member,"altavista")>0 THEN FoodFile=altavista_page ELSEIF InStr(member,"hotbot")>0 THEN FoodFile=hotbot_page ELSEIF InStr(member,"infoseek")>0 THEN FoodFile=infoseek_page ELSEIF InStr(member,"excite")>0 THEN FoodFile=excite_page ELSEIF InStr(member,"lycos")>0 THEN FoodFile=lycos_page ELSEIF InStr(member,"nlsearch")>0 THEN FoodFile=nlsearch_page ELSEIF InStr(member,"directhit")>0 THEN FoodFile=directhit_page ELSEIF InStr(member,"google")>0 THEN FoodFile=google_page ELSEIF InStr(member,"fast")>0 THEN FoodFile=fast_page ELSEIF InStr(member,"normal")>0 THEN FoodFile=normal_page ELSE FoodFile=generic_page END IF END IF END IF NEXT ELSE check_engine = 1 '# generic FoodFile is already assigned, but... FoodFile = generic_page END IF IF lcase(LEFT(foodfile,5))<>"http:" AND NOT (fso.FileExists(TemplatePath & FoodFile)) THEN FoodFile = normal_page END IF END SUB SUB redirect IF check_engine = 99 THEN FoodFile = normal_page END IF IF lcase(LEFT(foodfile,5))="http:" THEN Response.Redirect foodfile ELSE IF (fso.FileExists(TemplatePath & FoodFile)) THEN SET FoodFile = fso.OpenTextFile(TemplatePath & FoodFile,1,0) response.Write(FoodFile.ReadAll) FoodFile.Close ELSE msg = "
" & TemplatePath & FoodFile & " Doesn't exist." Response.Write(msg) END IF END IF END SUB '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' ' END FUNCTIONS ' ' ' '****************************************************************' %>