Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 redirect a user if they have cookie
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

rasure
Junior Member

289 Posts

Posted - 16 January 2004 :  13:31:27  Show Profile  Visit rasure's Homepage
Any one have any ideas on how to check that a user has the forum cookie already on their pc and if they do, redirect them to another page. I have a specific reason for this basically stopping a user from accessing the register page once already registered.

I've tried something like this so far...

strUsername = Request.Cookies(strUniqueID & "User")("Name")
If strUsername = "" Then
Response.Redirect("default.asp")

but I think that is checking and redirecting if they don't have the cookie/username, I need it to do the opposite, redirect them if they do have the cookie and or username.

any help would be appreciated

Psychic & Spiritual Development Resources

Edited by - rasure on 16 January 2004 13:32:19

Dave.
Senior Member

USA
1037 Posts

Posted - 16 January 2004 :  13:43:44  Show Profile
So if they have a User, you want them to go to default.asp?

strUsername = Request.Cookies(strUniqueID & "User")("Name")
If strUsername <> "" Then
Response.Redirect("default.asp")
end if
Go to Top of Page

rasure
Junior Member

289 Posts

Posted - 16 January 2004 :  13:53:44  Show Profile  Visit rasure's Homepage
Thanks Dave I was just using default to test it, the code is to be placed in register.asp so those who have already registered cant use the register page again, I know this has its problems for those who share PC`s but I've had enough of people causing trouble with more than one account, I know this isn't perfect or reliable but it all helps.

Is there a specific place in register.asp I should put it?

Psychic & Spiritual Development Resources

Edited by - rasure on 16 January 2004 16:47:17
Go to Top of Page

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 16 January 2004 :  17:28:57  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
First of all, I would use
If strDBNTUsername<>"" Then Response.Redirect("default.asp")

to check if the visiting user is a member.
(strDBNTUsername is determined by the same code as above in inc_header.asp)

I would paste it below the following code in register.asp (lines 35-42):
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->
<!--#INCLUDE FILE="inc_func_posting.asp"-->
<!--#include file="inc_profile.asp"-->
<%

so it looks like
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->
<!--#INCLUDE FILE="inc_func_posting.asp"-->
<!--#include file="inc_profile.asp"-->
<%
If strDBNTUsername<>"" Then Response.Redirect("default.asp")

My MODs:
Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook
Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch

Useful stuff:
Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz
Go to Top of Page

rasure
Junior Member

289 Posts

Posted - 16 January 2004 :  18:12:24  Show Profile  Visit rasure's Homepage
Thank you Onewaymule That works great if the user is already logged into the forum, but is there something to check to see if they have the forums cookie on their pc if they are not logged in to prevent them from having access to the register page or something along those lines?

I did have an idea of using a separate cookie using javascript after they had they had registered by clicking the activation key, but once cookie is on they cant activate their key, so is there a specific place in register.asp I could put it so it only sets the cookie after they activated their account.

I would rather use the forums own cookie if possible, but the above is another way if I can find the right place to put it in register.asp

Psychic & Spiritual Development Resources

Edited by - rasure on 16 January 2004 18:42:40
Go to Top of Page

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 16 January 2004 :  19:34:09  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
Hmm... are you sure you want this?

For example: a family is using 1 computer. 2 of them want to register for the local Snitz Forum (), but if this forum is using the code you plan to add, only one will be able to do so.
Also, it doesn't completely prevent an already registered user from getting to register.asp, since he could delete his cookies or visit the forum on a different machine for example.

I think removing the "Register" link in the forum navigation for logged on members would have a good effect.

My MODs:
Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook
Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch

Useful stuff:
Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 16 January 2004 :  20:40:42  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
quote:
Originally posted by OneWayMule


I think removing the "Register" link in the forum navigation for logged on members would have a good effect.



Alot better idea

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

rasure
Junior Member

289 Posts

Posted - 16 January 2004 :  20:53:21  Show Profile  Visit rasure's Homepage
Hi onewaymule, yes I have thought about this very carefully and I realize the issues involved, the register link has been removed for logged on members on my forum for about 6 months now and I know that deleting the cookies will allow them to register again, the more ways to try and stop them and make it more difficult for them the better as I'm pretty tired of wasting my time with those who just cause problems for other forum users, so I need to implement as many ways as possible, I know its probably a bit extreme but something has to be done about it once and for all

So is there a way to include the JavaScript cookie into register.asp so the cookie is placed on their pc when they go to activate their account with the activation key? and not when they initially sign up.

Thanks for you help

Psychic & Spiritual Development Resources

Edited by - rasure on 16 January 2004 20:54:45
Go to Top of Page

rasure
Junior Member

289 Posts

Posted - 17 January 2004 :  08:46:57  Show Profile  Visit rasure's Homepage
I've figured it out and put it on as a mod incase other may be interested

http://forum.snitz.com/forum/topic.asp?TOPIC_ID=50621

Psychic & Spiritual Development Resources
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.31 seconds. Powered By: Snitz Forums 2000 Version 3.4.07