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