Print Page | Close Window

script

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz NewsPad
Forum Description: Support forum for the Web Wiz NewsPad application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=24964
Printed Date: 28 March 2026 at 2:25am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: script
Posted By: net55
Subject: script
Date Posted: 08 December 2007 at 1:38am
trying to get this script to work with newspad works on other pages

<%
visitorIP = Request.ServerVariables("REMOTE_ADDR")
' Banned IP List
strBannedIPList="1.1.1.1,2.2.2.2"
arrBannedIPList=split(strBannedIPList,",")
visitorIP=request.ServerVariables("REMOTE_HOST")

For x=0 To ubound(arrBannedIPList)
If instr(visitorIP,arrBannedIPList(x)) then Response.Redirect("http://www.mysite.com/banned.asp")
Next
%>



Replies:
Posted By: net55
Date Posted: 08 December 2007 at 1:42am
the error i'm getting is:

Microsoft VBScript runtime  error '800a01f4'

Variable is undefined: 'visitorIP'

/proxyban.asp, line 2


Posted By: WebWiz-Bruce
Date Posted: 08 December 2007 at 10:33am
NewsPad uses Option Explicit which means you need to program properly and declare variables before they are used. You would need the following at the beginning of the code:-

Dim strBannedIPList
Dim arrBannedIPList
Dim visitorIP

-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net