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

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Redirect Script
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 4

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 12 July 2007 :  08:12:45  Show Profile  Send ruirib a Yahoo! Message
You need to add the topic_id to the querystring for that link, so more info is needed on the way you generate it. Can you post the part of the code that displays it?


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 12 July 2007 :  09:19:39  Show Profile  Visit leatherlips's Homepage
The link is in a forum post. It's just a standard link as inserted in any post.


Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 12 July 2007 :  09:26:35  Show Profile  Visit leatherlips's Homepage
Let me try to explain everything in more detail. I don't think I have doing a very good job at that.

I have a members only section of the forum called VIP Lounge (Allowed Members Only Hidden).

In a post within the VIP Lounge is a link to a page outside of the forum (but in the same domain). I'll call it members.asp. The link in the post points to members.asp

I want the link in that post to be the only way to be able to access the members.asp page. I thought the code in my first post would work but I learned that if you visit that page from any topic within any forum you could get to it. I want the members.asp page to somehow recognize exactly which post the link came from before it lets a person in. This will prevent VIP members from sharing the page with a non VIP member.

Not sure if I made more sense or not, but I'm trying.

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 12 July 2007 :  09:41:34  Show Profile  Send ruirib a Yahoo! Message
You just need to add some info to the link: at the end of it, add ?TOPIC_ID=300. If you don't do that, it will never work.


Snitz 3.4 Readme | Like the support? Support Snitz too
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 12 July 2007 :  09:59:22  Show Profile
So they don't have to have followed the link from that particular topic, they just need to be on the allowed members list for the forum the topic is posted in? If that's the case then the easiest way to do it is to set your cookies to website, grab their username & password from the cookie in your non-forum page, use them to get their MEMBER_ID from the MEMBERS table and then check that against the ALLOWED_MEMBERS table.

If you just pass the TOPIC_ID through the querystring to your non-forum page then VIP members can still provide non-VIP members with the URL.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”

Edited by - Shaggy on 12 July 2007 10:00:14
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 12 July 2007 :  10:06:05  Show Profile  Visit leatherlips's Homepage
quote:
Originally posted by Shaggy

...the easiest way to do it is to set your cookies to website, grab their username & password from the cookie in your non-forum page, use them to get their MEMBER_ID from the MEMBERS table and then check that against the ALLOWED_MEMBERS table.
That sounds like a good way to do it. Would anyone be willing to tell how to do that? I have no idea how.

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 12 July 2007 :  10:44:52  Show Profile
What database are you using for this forum?


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 12 July 2007 :  10:54:03  Show Profile  Visit leatherlips's Homepage
I'm using an Access database.

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 12 July 2007 :  10:55:59  Show Profile
OK, gimme a minute and I'll throw something together for you. In the meantime, you can set your forum's cookies to website.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 12 July 2007 :  11:19:52  Show Profile
Here you go:
dim objConn,strName,strPass,objRs
set objConn=server.createobject("ADODB.Connection")
objConn.open "your connection string"
strName=request.cookies("Snitz00User")("Name")
strPass=request.cookies("Snitz00User")("Pword")
set objRs=objConn.exeute("SELECT * FROM FORUM_ALLOWED_MEMBERS A,FORUM_MEMBERS M WHERE M.M_NAME='"&strName&"' AND M.M_PASSWORD='"&strPass&"' AND M.M_STATUS=1 AND A.FORUM_ID=1 AND A.MEMBER_ID=M.MEMBER_ID")
if not objRs.eof then
	Page Content
else
	Error Message
end if
objRs.close:set objRs=nothing:objConn.close:set objConn=nothing
You'll need to change all the parts I've highlighted in green to suit your needs and, if you're going to redirect to another page instead of displaying an error message, you'll need to destroy the recordset and database connection before doing so.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”

Edited by - Shaggy on 12 July 2007 11:45:53
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 12 July 2007 :  11:24:16  Show Profile  Visit leatherlips's Homepage
Shaggy, I can't test this out until I get home, but where do I insert the code? I assume in the page I am protecting, but where? In the head? Do I need to surround it with <% %>?

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 12 July 2007 :  11:46:01  Show Profile
That's the entire page, just drop your contents in where I've highlighted "Page Contents".


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 12 July 2007 :  15:54:14  Show Profile  Visit leatherlips's Homepage
I'm really dense. If I only insert what you provided (with the changes you suggested in green), then the code as well as everything else shows up as text.

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 12 July 2007 :  17:44:05  Show Profile
I would advise you to try out the code like this, by adding "<%" and "%>" at the top and bottom of the page.

<%

code

%>


CLPPR.com - All The News Only Seconds Away
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 12 July 2007 :  22:18:38  Show Profile  Visit leatherlips's Homepage
I have no idea if I'm implementing Shaggy's code correctly, but I am getting this error message:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name too long

/forum/vipbonus.asp, line 5


I have input the Data source name exactly as it appears on the admin_info.asp page.

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page
Page: of 4 Previous Topic Topic Next Topic  
Previous Page | Next Page
 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.3 seconds. Powered By: Snitz Forums 2000 Version 3.4.07