About Response.Redirect

Discussion in 'ASP General' started by qq, Feb 24, 2005.

  1. qq

    qq Guest

    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
     
    qq, Feb 24, 2005
    #1
    1. Advertising

  2. qq

    McKirahan Guest

    "qq" <> wrote in message
    news:...
    > 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.
     
    McKirahan, Feb 24, 2005
    #2
    1. Advertising

  3. qq

    qq Guest

    Do you know how to correct my program? Thanks.


    "McKirahan" wrote:

    > "qq" <> wrote in message
    > news:...
    > > 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.
    >
    >
    >
     
    qq, Feb 24, 2005
    #3
  4. qq

    Roland Hall Guest

    "McKirahan" <> wrote in message
    news:...
    :
    : 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
     
    Roland Hall, Feb 24, 2005
    #4
  5. qq

    Roland Hall Guest

    "Roland Hall" wrote in message news:...
    : "McKirahan" wrote in message
    : news:...
    ::
    :: 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
     
    Roland Hall, Feb 24, 2005
    #5
  6. qq

    Roland Hall Guest

    "Roland Hall" <nobody@nowhere> wrote in message
    news:%...
    : "Roland Hall" wrote in message
    news:...
    :: "McKirahan" wrote in message
    :: news:...
    :::
    ::: 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
     
    Roland Hall, Feb 24, 2005
    #6
  7. qq

    qq Guest

    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



    "Roland Hall" wrote:

    > "Roland Hall" <nobody@nowhere> wrote in message
    > news:%...
    > : "Roland Hall" wrote in message
    > news:...
    > :: "McKirahan" wrote in message
    > :: news:...
    > :::
    > ::: 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
    >
    >
    >
     
    qq, Feb 25, 2005
    #7
  8. qq

    Roland Hall Guest

    "qq" wrote in message
    news:...
    : 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://

    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:$");
    }
    ?>
    <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
     
    Roland Hall, Feb 26, 2005
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles A. Lackman
    Replies:
    2
    Views:
    8,042
    Charles A. Lackman
    Jan 11, 2006
  2. Matthew Wieder

    Response.Write and Response.Redirect

    Matthew Wieder, Jul 17, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    729
    Kevin Spencer
    Jul 17, 2003
  3. =?Utf-8?B?VHJveQ==?=

    Response.redirect does not redirect from .aspx page

    =?Utf-8?B?VHJveQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,300
    Srowe1975
    Oct 15, 2008
  4. Sal
    Replies:
    1
    Views:
    797
  5. Ron Howard
    Replies:
    2
    Views:
    543
    Ron Howard
    Aug 11, 2004
Loading...

Share This Page