Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Show if user logged in
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Show if user logged in

 Post Reply Post Reply Page  12>
Author
Andy Rowland View Drop Down
Groupie
Groupie
Avatar

Joined: 13 July 2004
Location: London
Status: Offline
Points: 86
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andy Rowland Quote  Post ReplyReply Direct Link To This Post Topic: Show if user logged in
    Posted: 07 March 2008 at 10:50pm
Is there a way of showing or not showing an area on a page only if you are logged in to the forum, eg Administartor.
I have a comments section on a page and only want registered forum members who are logged in to see the comments form.
I am using mySQL version of the forum.
Also using Dreamweaver.
Thanks
Who the hell is calling at this time?
Back to Top
StarDust View Drop Down
Senior Member
Senior Member


Joined: 14 May 2007
Location: Bangladesh
Status: Offline
Points: 310
Post Options Post Options   Thanks (0) Thanks(0)   Quote StarDust Quote  Post ReplyReply Direct Link To This Post Posted: 08 March 2008 at 1:30pm
It is located right left to this post. :)
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 March 2008 at 5:32pm
He isnt refering to the online status stardust.


anyway, if you want to make an area for members only just do:

<%
 if lngLoggedInUserID <> 2 then
    Response.Write("You are logged in")
 end if
%>


if you want it to be for Admins only just do:

<%
 if intGroupID = 1 then
    Response.Write("You are an Administrator")
 end if
%>


Also, i have a tutorial on Member-Only Pages. When i get time i intend to do a list of Member related commands (such as how to get the users id, username, group etc)
S2H.co.uk - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
StarDust View Drop Down
Senior Member
Senior Member


Joined: 14 May 2007
Location: Bangladesh
Status: Offline
Points: 310
Post Options Post Options   Thanks (0) Thanks(0)   Quote StarDust Quote  Post ReplyReply Direct Link To This Post Posted: 08 March 2008 at 9:03pm
My understanding is so poor. Sorry guys.

I am a bit weak in receiving department.
Back to Top
Andy Rowland View Drop Down
Groupie
Groupie
Avatar

Joined: 13 July 2004
Location: London
Status: Offline
Points: 86
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andy Rowland Quote  Post ReplyReply Direct Link To This Post Posted: 08 March 2008 at 9:17pm
Thanks for your help.
I have already used:
<%
 if lngLoggedInUserID <> 2 then
    Response.Write("You are logged in")
 end if
%>
 
and then scroll down until you get to the Latest Review and Add Review. I want to hide the Add Review form if you are not logged in using the forum.
Thanks.
Who the hell is calling at this time?
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: 10 March 2008 at 12:45pm
That page doesnt appear to be connected to the forum.

You would need to include the /forum/common.asp file into that page for the above code to work.

Check my Members Only tutorial and combine it with the above code for it to work.
S2H.co.uk - WebWiz Mods and Skins

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

Joined: 13 July 2004
Location: London
Status: Offline
Points: 86
Post Options Post Options   Thanks (0) Thanks(0)   Quote Andy Rowland Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2008 at 8:59pm

All I want is to hide the form on that page, not the entire page. As  understand your script blocks access to pages that include your code to none registerd forum members.

How would your code be used to do this on my page.
Thanks for your help on this.
Who the hell is calling at this time?
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: 11 March 2008 at 12:27pm
As I said, you will need to merge the two.

The tutorial tells you how to block access, so you would simply remove the redirecting code and change it to suit your needs.

basically you need this at the top of the page:

<!--#include virtual="/forum/common.asp" -->


and then you would use this where you want to hide:

<%
 if lngLoggedInUserID <> 2 then
%>

*What you want to hide here*

<%
   end if
%>


And then you need to add this at the bottom of the page to close any database connections created by the forum.

<% Call closeDatabase() %>

S2H.co.uk - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
 Post Reply Post Reply Page  12>

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.