Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Must be logged in to view
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Must be logged in to view

 Post Reply Post Reply
Author
Exis View Drop Down
Groupie
Groupie
Avatar

Joined: 24 October 2002
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote Exis Quote  Post ReplyReply Direct Link To This Post Topic: Must be logged in to view
    Posted: 08 November 2006 at 11:28am
Hello everyone,

Just a quick question. Is there anyway I can insert an include into anyone of my homepages which when you visit, you must be logged into WebWiz to view?

IE: You must log into the message boards to view certain pages on my websites. Understand?

Any help would be greatly appreciated!

Many Thanks
Back to Top
JasonPEC View Drop Down
Newbie
Newbie


Joined: 02 March 2006
Location: United States
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote JasonPEC Quote  Post ReplyReply Direct Link To This Post Posted: 08 November 2006 at 2:30pm
I use this code to redirect anyone that's not logged into the forum to the forum login page and denies access to the page they're trying to view until they log in (the page you place this code on must have an .asp extension):
 
<!--#include virtual="/forum/common.asp" -->
 
<%
If lngLoggedInUserID = 2 then
   response.redirect("/forum/login_user.asp")
End If
%>
 
Your file paths may differ.


Edited by JasonPEC - 08 November 2006 at 2:32pm
Back to Top
Exis View Drop Down
Groupie
Groupie
Avatar

Joined: 24 October 2002
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote Exis Quote  Post ReplyReply Direct Link To This Post Posted: 08 November 2006 at 4:33pm
Fantastic, Thanks jason Thumbs%20Up
Back to Top
JasonPEC View Drop Down
Newbie
Newbie


Joined: 02 March 2006
Location: United States
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote JasonPEC Quote  Post ReplyReply Direct Link To This Post Posted: 08 November 2006 at 6:05pm
Originally posted by Exis Exis wrote:

Fantastic, Thanks jason Thumbs%20Up
 
You're welcome. Hope it works for you.
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 08 November 2006 at 6:08pm
i would recommend closing the connections to the database


<!--#include virtual="/forum/common.asp" -->
 
<%
If lngLoggedInUserID = 2 then
   'Release server objects
   Call closeDatabase()

   response.redirect("/forum/login_user.asp")
End If
%>


and then once your finished with the DB on your page close it using this (the part in red above basically)

<%
   'Release server objects
   Call closeDatabase()
%>

S2H.co.uk - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
Exis View Drop Down
Groupie
Groupie
Avatar

Joined: 24 October 2002
Status: Offline
Points: 44
Post Options Post Options   Thanks (0) Thanks(0)   Quote Exis Quote  Post ReplyReply Direct Link To This Post Posted: 08 November 2006 at 7:16pm
Perfect! Working fine! Thanks to both of you. Thumbs%20Up
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.