• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 215
  • Last Modified:

HTML access to an FTP site

Hi!

I'd like to be able to have a user input a username and password into an HTML form, then have that information passed to another URL in the form of:

ftp://username:password@ftp.domain.com

and take them there...

Thanks!
You guys are the best!
0
scotphil
Asked:
scotphil
  • 6
  • 3
  • 2
  • +1
1 Solution
 
brunoCommented:
ummmm....can you use ASP?


<%
username = request.form("username")
password = request.form("password")

response.redirect "ftp://" & username & ":" & password & "@ftp.domain.com"
%>
0
 
scotphilAuthor Commented:
Hi!

I'm not sure if they can or not...
Is there another solution???

Thanks!
0
 
brunoCommented:
there's probably a way to do it with javascript, but it wouldn't be NEARLY as easy...

why don't you just ask if they can use ASP?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
scotphilAuthor Commented:
ok...I'll find out....but since it's the holiday...I won't know until Monday...

Thanks...

0
 
brunoCommented:
no problem, in the meantime hopefully someone will stop by with the javascript version
0
 
CJ_SCommented:
<form onSUbmit="window.open('ftp://'+this['txtUser'].value+':'+this['txtPassword'].value+'@ftp.domain.com');return false;">
 username: <input type=text name="txtUser"><br>
 password: <input type=text name="txtPassword"><br>
 <input type=submit>
</form>
 
0
 
mouattsCommented:
You aren't going to be able to do it with a form without using javascript as the username/password must appear as part of the URL requested, And the submission of a form (which is only understood within HTTP) would not be able to do this. SO CJS answer is the best you are going to get.

Doing it with ASP isn't going to do much for you apart from add at least one round trip to the server over and above the javascript solution.

Steve
0
 
brunoCommented:
Steve,

what are you talking about?

what's wrong with my solution?


BRUNO
0
 
mouattsCommented:
Nothing wrong except that you have had to go back to the server whereas the javascript approach doesn't
0
 
scotphilAuthor Commented:
ok, the server will run .asp pages 8-)

since I'm not an .asp guru could you possibly write the page for me?

I did try the javascript solution, but was unable to make the script work without generating an error...probably something I neglected to add in order to make it work.

Thanks a bunch!
0
 
brunoCommented:
>>since I'm not an .asp guru could you possibly write the page for me?


really all you need is what I posted above...



have this be the page your form submits to

redirect.asp
=====================
<%
username = request.form("username")
password = request.form("password")

response.redirect "ftp://" & username & ":" & password & "@ftp.domain.com"
%>




your original page with the form

form.asp
=====================
<html>
<head>
     <title>Untitled</title>
     
</head>

<body>
<form action="redirect.asp" name="myForm">
user: <input name="username">
<br />
pw: <input name="password">
<input type="submit" value="submit">
</form>
</body>
</html>
0
 
brunoCommented:
Glad I could help, thanks for the A!  :-)
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 6
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now