URLencode- how do you decode?

  • Thread starter Thread starter Mike Mueller
  • Start date Start date
M

Mike Mueller

I am using one of those wonderful asp/database security combos, and the page
requested is encoded. I would like the user to login and then go to the
page they desired, as opposed to a generic menu. Probably a simple thing
that I haven't thought of yet.

Mike
 
It depends entirely on what kind of encoding. If you're talking about ASP,
it's Server.UrlDecode.

--
Jim Cheshire
Jimco
http://www.jimcoaddins.com
================================
Author of Special Edition
Using Microsoft Office FrontPage 2003
5 Stars on Amazon and B&N
================================
The opinions expressed by me in the
newsgroups are my own opinions and
are in no way associated with my
employer or any other party. Jimco is
not associated in any way with any other
entity.
 
Mike,
you shouldn't need to decode> presumably you want something like this?

at the top of a secured page
<%
if ' user is not authenticated then
response.redirect
"Login.asp?page=<%=server.urlencode(request.servervariables("script_name"))%
end if
%>

and then on login.asp
<%
if request.form <> "" then
' check user credentials
' if we get here he's logged in redirect him
' either to the page he wanted or a default page
if request("page") <> "" then
response.redirect request("page")
else
response.redirect "DefaultLoggedInPage.asp
end if
else
%>
<form method="post" action="login.asp">
' user and pass fields here
<input type="hidden" name="page" value="<%=request("page")%>">

Jon
Microsoft MVP - FP
 
Once again, I need to say Thank You Jon

Mike


Jon said:
Mike,
you shouldn't need to decode> presumably you want something like this?

at the top of a secured page
<%
if ' user is not authenticated then
response.redirect
"Login.asp?page=<%=server.urlencode(request.servervariables("script_name"))%
end if
%>

and then on login.asp
<%
if request.form <> "" then
' check user credentials
' if we get here he's logged in redirect him
' either to the page he wanted or a default page
if request("page") <> "" then
response.redirect request("page")
else
response.redirect "DefaultLoggedInPage.asp
end if
else
%>
<form method="post" action="login.asp">
' user and pass fields here
<input type="hidden" name="page" value="<%=request("page")%>">

Jon
Microsoft MVP - FP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top