About Response.Redirect

Q

qq

Hi,

Does anyone know about Response.Redirect? I want user to login to our FTP
server via an asp page on my website with their username and password. I have
created a form with username and password in a .html. User input their
username and password from the page. And I created a .asp file as follows to
redirect our FTP Server.

<%@ LANGUAGE = "VBScript" %>
<% Option Explicit %>
<% Dim username
username = Request.Form("username") %>
<% Dim password
password = Request.Form("password") %>
<% Dim URL
URL = "ftp://" & username & ":" & password & "@ftp.mysite.com"
Response.Redirect URL
%>

It doesn’t work. But it is working when I change to URL =
“http://www.mysite.comâ€.

Can anybody help out the issue? Thanks a lot.

--Qing
 
M

McKirahan

qq said:
Hi,

Does anyone know about Response.Redirect? I want user to login to our FTP
server via an asp page on my website with their username and password. I have
created a form with username and password in a .html. User input their
username and password from the page. And I created a .asp file as follows to
redirect our FTP Server.

<%@ LANGUAGE = "VBScript" %>
<% Option Explicit %>
<% Dim username
username = Request.Form("username") %>
<% Dim password
password = Request.Form("password") %>
<% Dim URL
URL = "ftp://" & username & ":" & password & "@ftp.mysite.com"
Response.Redirect URL
%>

It doesn't work. But it is working when I change to URL =
"http://www.mysite.com".

Can anybody help out the issue? Thanks a lot.

--Qing

That URL format is disallowed with WinXP SP2.
 
R

Roland Hall

:
: That URL format is disallowed with WinXP SP2.

I thought that was only for HTTP, not FTP?!

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 
R

Roland Hall

in message : "McKirahan" wrote in message
: ::
:: That URL format is disallowed with WinXP SP2.
:
: I thought that was only for HTTP, not FTP?!

Make that HTTP(S). Wonder if this is still viable?!
http://www.eggheadcafe.com/PrintSearchContent.asp?LINKID=594

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 
R

Roland Hall

: "Roland Hall" wrote in message
:: "McKirahan" wrote in message
:: :::
::: That URL format is disallowed with WinXP SP2.
::
:: I thought that was only for HTTP, not FTP?!
:
: Make that HTTP(S). Wonder if this is still viable?!
: http://www.eggheadcafe.com/PrintSearchContent.asp?LINKID=594

Additional:
http://support.microsoft.com/default.aspx?scid=kb;en-us;834489
http://www.experts-exchange.com/Web/Q_21150155.html

While any connections not over an SSL or through a tunnel can be sniffed,
username:password doesn't make it any less secure but if log files recorded
it, then that would.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 
Q

qq

Hi, Roland,

Thank you for your help. Because Response.Redirect is just only for HTTP, So
I use the follows code.

<% Dim username
username = Request.Form("username") %>
<% Dim password
password = CStr(Request.Form("password")) %>
<% Dim URL
URL = "ftp://" & username & ":" & password & "@ftp.mysite.com"
%>

<html>

<script language="vbscript">

sub winopen(surl)
sfeature="toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=680,height=500"
window.open surl,null,sfeature
'any other things
end sub

</script>

<body onload=winopen("<%= URL %>")>

</body>
</html>

My problem is:

<body onload=winopen(“ftp://ftp.mysite.comâ€)> works, I can got my ftp
server, a login screen come up.

But <body onload=winopen(“ftp://test:password$#*@ftp.mysite.comâ€)> doesn’t
working. And give me a error message:
Cannot find ‘ftp://test:password$/’. Make sure the path or Internet address
is correct.

Could you give me some idea to figure out it? Or do you have any another way
to solve my problem? Thanks a lot.

--Qing
 
R

Roland Hall

in message
: Thank you for your help. Because Response.Redirect is just only for HTTP,
So
: I use the follows code.
:
: <% Dim username
: username = Request.Form("username") %>
: <% Dim password
: password = CStr(Request.Form("password")) %>
: <% Dim URL
: URL = "ftp://" & username & ":" & password & "@ftp.mysite.com"
: %>
:
: <html>
:
: <script language="vbscript">
:
: sub winopen(surl)
:
sfeature="toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=680,height=500"
: window.open surl,null,sfeature
: 'any other things
: end sub
:
: </script>
:
: <body onload=winopen("<%= URL %>")>
:
: </body>
: </html>
:
: My problem is:
:
: <body onload=winopen("ftp://ftp.mysite.com")> works, I can got my ftp
: server, a login screen come up.
:
: But <body onload=winopen("ftp://test:password$#*@ftp.mysite.com")> doesn't
: working. And give me a error message:
: Cannot find 'ftp://test:password$/'. Make sure the path or Internet
address
: is correct.
:
: Could you give me some idea to figure out it? Or do you have any another
way
: to solve my problem? Thanks a lot.

I'm not sure why you need to open a new window with location.href would work
just fine.
Two more things:
1. language= is deprecated. use type="text/vbscript" instead.
2. Client-side VBScript should not be used on the Internet. Use javascript
instead.

Ok, it works for me but your password may have to be URL or HTML encoded
because of the characters in your password. I get a prompt to enter my
password but after I tell it to save it and log in once, it works from then
on. This means you probably only need:
ftp://[email protected]

I'm not a fan of putting my password in a URL, even if it is passed in clear
text if entered manually.
The best thing to do is use secure FTP, which MSFT's FTP server doesn't
support or use WebDav over SSL or through a VPN tunnel.

If you can use PHP, this will also work: (this file would have to be called
ftp.php or change the action="")
<?
if($action=="login"){
Header ("Location: ftp://$username:[email protected]");
}
?>
<form action="ftp.php?action=login" method="post" enctype="text/plain">
<table><tr><td>
username: <INPUT NAME="username" TYPE="text" SIZE=20><BR>
password: <INPUT NAME="password" TYPE="password" SIZE=20><BR>
</td></tr>
<tr><td align=center>
<INPUT TYPE="submit" value="submit" style="color: #ffffff; background-color:
#000000">
</td></tr></table>
</FORM>

HTH...

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top