Solved

HTML access to an FTP site

Posted on 2002-07-03
12
199 Views
Last Modified: 2010-04-09
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
Comment
Question by:scotphil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 2
  • +1
12 Comments
 
LVL 18

Expert Comment

by:bruno
ID: 7128052
ummmm....can you use ASP?


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

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

Author Comment

by:scotphil
ID: 7128237
Hi!

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

Thanks!
0
 
LVL 18

Expert Comment

by:bruno
ID: 7128288
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:scotphil
ID: 7128778
ok...I'll find out....but since it's the holiday...I won't know until Monday...

Thanks...

0
 
LVL 18

Expert Comment

by:bruno
ID: 7128854
no problem, in the meantime hopefully someone will stop by with the javascript version
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 7129492
<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
 
LVL 11

Expert Comment

by:mouatts
ID: 7139346
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
 
LVL 18

Expert Comment

by:bruno
ID: 7139365
Steve,

what are you talking about?

what's wrong with my solution?


BRUNO
0
 
LVL 11

Expert Comment

by:mouatts
ID: 7139457
Nothing wrong except that you have had to go back to the server whereas the javascript approach doesn't
0
 
LVL 2

Author Comment

by:scotphil
ID: 7139468
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
 
LVL 18

Accepted Solution

by:
bruno earned 500 total points
ID: 7139581
>>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
 
LVL 18

Expert Comment

by:bruno
ID: 7150986
Glad I could help, thanks for the A!  :-)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Timer on div 5 36
HTML or/and CSS codes to construct numbered paragraphs. 5 35
Ajax on ASP 2 67
PHP Command to Open New Tab/Page using Window.Open 3 33
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question