URLencode- how do you decode?

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
 
J

Jim Cheshire

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.
 
J

Jon

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
 
M

Mike Mueller

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
 
Top