Here is the code at the top of the first page. I added the "?Page=linkspda.asp" part
Expand|Select|Wrap|Line Numbers
- <%
- If Session("BlnLoggedIn") <> True Then
- Response.Redirect("http://mywebsite.somewhere.com/login.asp?Page=linkspda.asp")
- End If
- %>
The login.asp page looks like this:
Expand|Select|Wrap|Line Numbers
- <%
- Response.Expires = -1000 'Make sure the browser doesn't cache this page
- Response.Buffer = True 'enables our response.redirect to work
- %>
- <html>
- <head><title>Password Protect your ASP pages</title>
- </head>
- <body>
- <%
- If Request.Form("submit") ="Login" Then
- CheckLoginForm
- Else
- ShowLoginForm
- End If
- %>
- <%
- Sub CheckLoginForm
- testvar = Request.QueryString("Page")
- 'check if the value of the text field 'username' and 'password' are correct
- If Request.Form("username") = "test" AND Request.Form("password") = "pass" Then
- Session("BlnLoggedIn") = True
- Response.Redirect testvar
- Else
- Response.Write "<div align='center'>You are not logged in.</div><br>"
- ShowLoginForm
- End If
- End Sub
- %>
- <% Sub ShowLoginForm %>
- <div align='center'>
- <!-- start the HTML login form -->
- <form name="form" action="login.asp" method="post">
- <table>
- <tr>
- <td><font size="8">User Name :</font></td>
- <td><input type="text" style="font-size:48px" name="username"></td></tr>
- <tr>
- <td><font size="8">Password : </font></td>
- <td><input type="password" style="font-size:48px" name="password"></td></tr>
- <tr><td colspan="2"><input type="submit" style="font-size:48px" name="submit" value="Login"></td></tr>
- </table>
- </form>
- <!-- end the HTML login form -->
- </div>
- <% End Sub %>
- </body>
- </html>
testvar = Request.QueryString("Page")
and
Response.Redirect testvar
The Response.Redirect was just:
Response.Redirect "linkspda.asp"
The Request.QueryString("Page") does not seem to contain anything.
What am I doing wrong?
Thanks,
Scott