How do i write that Sorry, you are not logged in ... to the login.asp?Code:<% username = Session("username") if ("" = username) Then Response.redirect "login.asp" response.Write("Sorry, you are not logged in.") response.End End if %>
How do i write that Sorry, you are not logged in ... to the login.asp?Code:<% username = Session("username") if ("" = username) Then Response.redirect "login.asp" response.Write("Sorry, you are not logged in.") response.End End if %>
I don't 'do' ASP so I can't provide specifics.Originally Posted by TheShadow
I assume that login.asp is used to receive input from the user. If so, the login.asp should be checking the input itself. That is, it should submit the form to itself.
If the data is invalid, you can serve up a slightly different document with an error message inserted. If valid, login.asp can redirect to a member page, or wherever is most appropriate.
Time delayed redirection, like that used in this forum when logging in, should be avoided in my opinion, mainly because that type of redirection is non-standard, generally frowned upon, and can be disabled (in other words, it's not reliable).
Mike
Hi Shadow,
You're best bet is to querystring the response.redirect, for example:
Then, in the code of you're login.asp page, where you want the message to appear, put an If statement:Code:<% username = Session("username") if ("" = username) Then Response.redirect "login.asp?status=notloggedin" response.End End if %>
I hope this worksCode:<% if request.querystring("status") = "notloggedin" then response.write("Sorry, you are not logged in.") %>
Carl.
Bookmarks