The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
I have a pop up page that I only want accessible by moderators or admins. Right now if someone types in the URL they can see it. I want them to get a message saying the page is not able to be viewed by them.
I think it has to do with mlev = 2 or something but I don't know how to add it.<
I think it has to do with mlev = 2 or something but I don't know how to add it.<
Posted
I found out the answer myself. At least I think this is the right way to do it. It appears to be working.
I added this near the top of the page after the includes:
<
I added this near the top of the page after the includes:
Code:
If mLev < 2 Then
Response.Redirect("default.asp")
End If
Posted
1 = Member
2 = Author
3 = Moderator
4 = Admin
What you have will work, but normally it would be:
<
2 = Author
3 = Moderator
4 = Admin
What you have will work, but normally it would be:
Code:
if mLev < 3 then
Response.Redirect("default.asp")
end if<
Posted
so what does this bit fo code do then? its in all the admin_ pages
<
Code:
if Session(strCookieURL & "Approval") <> "15916941253" then
scriptname = split(request.servervariables("SCRIPT_NAME"),"/")
Response.Redirect "admin_login.asp?target=" & scriptname(ubound(scriptname))
end if© 1999-2010 MaD2ko0l
Posted
Mad, I found if you use the session check and the admin/moderator has time expired or not logged in, the popup window diverts to a full forum page with full header and full footer, all crammed into the small pop up window. No problems though if an external visitor types the popup window url into the browser window then the full page is ok.
This if mLev < 3 then Response.Redirect("default.asp") end if allows you to ignore time sessions etc and points the vistor to the default, straight away.<
This if mLev < 3 then Response.Redirect("default.asp") end if allows you to ignore time sessions etc and points the vistor to the default, straight away.<
Posted
I remember the guys here talking about the "15916941253" part a long time ago and how the number is just an arbitrary number. I am pretty sure you can change it to what you want as long as you do it throughout your code. I think I also remember another person who made the number longer while another person made the number random with a generator.
From what I remember those statements are true.
Is that the question you were asking?
<
From what I remember those statements are true.
Is that the question you were asking?
<
Last edited by Etymon on 01 August 2008, 11:09
Posted
This bit of code is doing what I want:
If mLev < 3 Then
Response.Redirect("default.asp")
End If
Thanks!<
If mLev < 3 Then
Response.Redirect("default.asp")
End If
Thanks!<
Email Member
Message Member
Post Moderation
FileUpload
If you're having problems uploading, try choosing a smaller image.
Preview post
Send Topic
Loading...