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

ILLHILL
Junior Member

Netherlands
341 Posts

Posted - 10 July 2007 :  20:51:38  Show Profile
quote:
Originally posted by ruirib

ILLHILL made a small mistake. Where he used "<>" you should use "=", in the 2nd If statement.
Try it.



I assumed 300 was the Id where the redirect was supposed to come from, so I added <> 300 instead of = 300 to redirect to no.html if the id wasn't 300.

I'm a bit confused now :)

Greets & sleep well for now (2:57 AM local time).

D

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

leatherlips
Senior Member

USA
1838 Posts

Posted - 10 July 2007 :  21:01:30  Show Profile  Visit leatherlips's Homepage
Sorry ruirib, it did not work. AnonJr is correct in what I am trying to do.

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

AnonJr
Moderator

United States
5768 Posts

Posted - 10 July 2007 :  21:09:53  Show Profile  Visit AnonJr's Homepage
I think we've all been a little confused on this one... - but we'll get it worked out.
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 11 July 2007 :  06:45:43  Show Profile  Send ruirib a Yahoo! Message
A small correction to AnonJr's contribution:

<%
If Request.QueryString("TOPIC_ID") = "300" And Instr(Request.ServerVariables("http_Referer"),"mangionemagic.com/forum/topic.asp")<1 Then
Response.Redirect "no.htm"
End If
%>

I don't see why this should fail.

ILLHILL, sorry, my mistake, I was the one who got it wrong.


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

leatherlips
Senior Member

USA
1838 Posts

Posted - 11 July 2007 :  15:09:36  Show Profile  Visit leatherlips's Homepage
I'm starting to feel like a heel, but that script doesn't work either.

It allows me to come from any topic to my target page, not just Topic_ID 300.

The way I am testing this is I am putting the link in another topic other than 300. In theory, the target page should see it is not from topic 300 and should redirect me to the no.html but it doesn't. It just lets me right in.

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 - 11 July 2007 :  16:07:38  Show Profile  Send ruirib a Yahoo! Message
I keep mixing '=' and '<>'. Try replacing the '=' by '<>'.


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

AnonJr
Moderator

United States
5768 Posts

Posted - 11 July 2007 :  17:25:17  Show Profile  Visit AnonJr's Homepage
It doesn't matter if you use = or <> since the topic ID isn't getting passed to the page that is running the script. You will either need to pass your own token in the link on the topic page or do like my earlier suggestion with the cookie.
Go to Top of Page

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 11 July 2007 :  17:32:20  Show Profile  Send ruirib a Yahoo! Message
quote:
Originally posted by AnonJr

It doesn't matter if you use = or <> since the topic ID isn't getting passed to the page that is running the script. You will either need to pass your own token in the link on the topic page or do like my earlier suggestion with the cookie.



Yeah, if the topic_id isn't being sent to the page, it doesn't make a difference.


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

leatherlips
Senior Member

USA
1838 Posts

Posted - 11 July 2007 :  19:01:07  Show Profile  Visit leatherlips's Homepage
Using <> or = does not work.

What is the best way to go about protecting the target page? AnonJr, your idea sounds good, but I have no idea how to do that.

I want to prevent anyone from sending the link to someone else. If they tried to get to it in any other way other than the forum I want to block it.

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 - 11 July 2007 :  19:06:19  Show Profile  Send ruirib a Yahoo! Message
What Anon meant was that your redirecting link is not passing the topic_id. You can change it so that it does... or try Anon's solution. A topic_id solution requires you to use '<>'.


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

leatherlips
Senior Member

USA
1838 Posts

Posted - 11 July 2007 :  20:18:06  Show Profile  Visit leatherlips's Homepage
quote:
Originally posted by ruirib

What Anon meant was that your redirecting link is not passing the topic_id. You can change it so that it does...

I have no idea how to do that. I am not asp literate (obviously). I thank you for your continued patience and help. I've tried using the <> and the = but neither of them prevent access from any other topic.asp page. It treats them all the same as if the ID didn't matter. I don't know how to get the page to recognize the topic id.

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 - 11 July 2007 :  20:40:52  Show Profile  Send ruirib a Yahoo! Message
Seems like it's topic.asp that you need to change...


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 :  06:46:42  Show Profile  Visit leatherlips's Homepage
Would the following work?

What if I took a topic.asp page and renamed it to something else such as membersonly.asp. I would then strip out everything except that which pertained to the login check. Then I would insert the special content I want. Would that work? If so, what exactly would I need to keep that checks for log in and member status?

I'm thinking this would take them right to the membersonly.asp page if they were already logged in. If they weren't logged in, it would take them to the log in page and then take them to the membersonly.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

ruirib
Snitz Forums Admin

Portugal
26364 Posts

Posted - 12 July 2007 :  06:50:49  Show Profile  Send ruirib a Yahoo! Message
If I'm correct, you have a link to the special page in topic.asp, right? What's the code for that link?


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 :  08:06:59  Show Profile  Visit leatherlips's Homepage
It is just a simple link as you would make within a post using forum code.

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.29 seconds. Powered By: Snitz Forums 2000 Version 3.4.07