Print Page | Close Window

Show if user logged in

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=25409
Printed Date: 03 April 2026 at 8:24pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Show if user logged in
Posted By: Andy Rowland
Subject: Show if user logged in
Date 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?



Replies:
Posted By: StarDust
Date Posted: 08 March 2008 at 1:30pm
It is located right left to this post. :)

-------------
http://board.ebizbd.net/">Tips, mods and skins for WWF v9.x


Posted By: Scotty32
Date 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 http://www.s2h.co.uk/wwf/tips/intergration/member-only-pages.asp - 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 - 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 .


Posted By: StarDust
Date Posted: 08 March 2008 at 9:03pm
My understanding is so poor. Sorry guys.

I am a bit weak in receiving department.

-------------
http://board.ebizbd.net/">Tips, mods and skins for WWF v9.x


Posted By: Andy Rowland
Date 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
%>
 
Go to http://www.cookmaroc.co.uk/StartersDetails.asp?RecID=8 - http://www.cookmaroc.co.uk/StartersDetails.asp?RecID=8
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?


Posted By: Scotty32
Date 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 - 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 .


Posted By: Andy Rowland
Date 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?


Posted By: Scotty32
Date 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 - 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 .


Posted By: Andy Rowland
Date Posted: 13 March 2008 at 12:17am
Thanks for your help.
I managed to get it to work in Firefox but not in IE. Even after I log in to the Forum, my form does not show.
Are there some other settings I need to change?
Thanks


-------------
Who the hell is calling at this time?


Posted By: Andy Rowland
Date Posted: 18 March 2008 at 8:09pm
Don't know what I did but it is now working on both Firefox and IE.

-------------
Who the hell is calling at this time?


Posted By: Scotty32
Date Posted: 18 March 2008 at 8:47pm
If dont correctly it shouldnt make a difference which browser is used as ASP is server-side scripting.

The browser only see's the HTML produced by the server, which is the same for IE and FireFox


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



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