Print Page | Close Window

restrict access to forums?

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=8984
Printed Date: 07 April 2026 at 3:24pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: restrict access to forums?
Posted By: DDC Web Guy
Subject: restrict access to forums?
Date Posted: 16 January 2004 at 2:32pm

My client has a "members only" site in which he would like a forums section. I am trying to figure out how to only allow users that have logged correctly into his site to be able to utilize the Web Wiz Forums.

I am using ASP.VBScript to authenticate the users for his site. However, whenever I try to ammend the header.asp file with the server behavior that would normally restrict a user's access to a page, I get errors when I try to load WWF on my browser.

Suggestions anyone?




Replies:
Posted By: WebWiz-Bruce
Date Posted: 16 January 2004 at 6:19pm
What are the errors????

-------------
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


Posted By: DDC Web Guy
Date Posted: 21 January 2004 at 9:46am

My error messages are listed below, along with what changes I made to the header.asp file. Keep in mind, that I want to be able to restrict user access to the forum to members of the parent site. Likewise, I want users to be able to logout from the parent site like they can do from any other site page.

1.  AFTER COPYING HEADER INFORMATION THAT APPEARS AT THE TOP OF ALL PARENT SITE PAGES (INCLUDES LOGOUT BEHAVIOR)

Microsoft VBScript runtime error '800a01f4'
Variable is undefined: 'MM_Logout'
/WebWiz/forum/includes/header.asp, line 89

2.  REMOVED LOGOUT BEHAVIOR

Active Server Pages error 'ASP 0141'
Page Command Repeated
/WebWiz/forum/includes/header.asp, line 1
The @ command can only be used once within the Active Server Page.

3.  REMOVED "<mailto:%@LANGUAGE="VBscript"%'>%@LANGUAGE="VBSCRIPT"%>" FROM LINE 1

page loads

4.  ADDED BEHAVIOR TO RESTRICT PAGE ACCESS

Active Server Pages error 'ASP 0141'
Page Command Repeated
/WebWiz/forum/includes/header.asp, line 1
The @ command can only be used once within the Active Server Page.

5.  REMOVED "<mailto:%@LANGUAGE="VBscript"%'>%@LANGUAGE="VBSCRIPT"%>" FROM LINE 1 (AGAIN)

Microsoft VBScript runtime error '800a01f4'
Variable is undefined: 'MM_authorizedUsers'
/WebWiz/forum/includes/header.asp, line 3

Thanks!
James

 



Posted By: WebWiz-Bruce
Date Posted: 21 January 2004 at 1:13pm
All these errors are happening becuase you are trying to intergarte other code into the forum.

The problem isn't with the forum codes, it's with the code that you are trying to put into it yourself, it's bad coding and looking at the MM part I guess you are trying to use Dreamweaver to write the code.

Most of these errors are happening becuase you are trying to introduce new variables without first declaring them (this is bad programming practise).

You need to either remove the Option Explicit line from each file of the forum, or correct the bad programming and declare all the new varaibles that you are introducing before using them using dim statements. eg:-

Dim MM_authorizedUsers

The < mailto:%@LANGUAGE=%22VBscript%22% - %@LANGUAGE="VBSCRIPT"% > error is happening becuase the forum already uses that line in it's code and the new code you are introducing also has it. This line can only be used once.




-------------
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


Posted By: DDC Web Guy
Date Posted: 21 January 2004 at 2:07pm

All of this "bad code" works perfectly fine in all other pages on the parent site.

Once a user has logged in to the site, he/she is able to logout from anywhere on the site using the very code that you are saying is "bad." Likewise, any non-member whom tries to access a restricted page on the site is appropriately redirected to a "Please log-in first" page.

But simply copying all header code into the header.asp file is not working for me. I am not saying that some of the .ASP code possibly doesn't need some tweaking to make it work ("Hey! That's kinda why I am here in the first place."), but to just label all of it as "bad coding" I don't feel is fair.

And yes, I am using Macromedia Dreamweaver (MX 2004 to be exact)and their built in behaviors. I am not a proficient .ASP programmer by any stretch.

I am just hoping someone might give me some suggestions as to why my code does not work when I copy it into my header.asp as is suggested in the help files and in this forum.

Thanks!
James



Posted By: WebWiz-Bruce
Date Posted: 21 January 2004 at 2:47pm
If you read my last post you will see that I have given a suggestion to fix the code.

Variables should always be declared, but VbScript has option explicit turned off by default so that it allows you to get away with sloppy coding (such as that done by programs like Dreamweaver). So yes the code would run in the rest of your site as option explicit isn't enabled allowing sloppy code to run.

In the forum code stricter coding standards are used so option explicit is turned on, this forces all variables to have to be declared before being used.

If you read my last post I did give a suggestion on how to fix Dreamweavers sloppy coding, or removing the option explicit from each file used in thf forum.


-------------
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


Posted By: MadDog
Date Posted: 21 January 2004 at 3:52pm
Originally posted by DDC Web Guy DDC Web Guy wrote:

All of this "bad code" works perfectly fine in all other pages on the parent site.

Just because it works doesnt mean its good code.

If its made in Dreamweaver, i bet the code is extremly bad. Dreamweaver sucks for programming ASP. Hell, just about all Rich Text Editors suck for programming ASP.



-------------
http://www.iportalx.net" rel="nofollow">



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