code to redirect guests away?
Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=26966
Printed Date: 29 March 2026 at 9:52am Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: code to redirect guests away?
Posted By: jarv
Subject: code to redirect guests away?
Date Posted: 11 February 2009 at 10:58am
Hi,
I would like my forum to be very secure (not available for the public). Does anyone have any code that redirects visitors to the login page if they try to look at the forum?
thanks
J
|
Replies:
Posted By: jarv
Date Posted: 11 February 2009 at 4:26pm
sorted, I am using:
<% @ Language=VBScript %> <% Option Explicit %> <!--#include file="common.asp" --> <% If blnGuest AND blnGuestSessions = True Then response.Redirect("login_user.asp") End If %>
|
at the top of my other pages
|
Posted By: Scotty32
Date Posted: 11 February 2009 at 5:58pm
As I said in my http://www.s2h.co.uk/wwf/tips/intergration/member-only-pages.asp" rel="no follow - Member-Only Pages you should make sure to close the connection to the database.
you can do this by adding the following line to your code:
<% @ Language=VBScript %> <% Option Explicit %> <!--#include file="common.asp" --> <% If blnGuest AND blnGuestSessions = True Then Call closeDatabase() response.Redirect("login_user.asp") End If %> |
Though you dont need the Guest Sessions part as i believe that relates to the ?SID=245435645 in URLs, and I simply used the lngLoggedInUserID = 2 in my tutorial which is the "Guest" members Author ID in the database.
You could also adapt this so that you could enter it into the common.asp file, with an added variable blnNoLogin which you would add to pages such as registration pages and the login page its self, like so:
blnNoLogin = true
------------- S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins
For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .
|
|