By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,310 Members | 1,430 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,310 IT Pros & Developers. It's quick & easy.

ftp via a form on page html ??

P: n/a
To reach their accompte ftp via a page html, I place a form for our
customer on a page. I found this code. But it doesn't work because I
reach the base of the server and not directly the own customer
accompte?? I have to change something on my ftp server or on the html
page?? Thanks. pascal joseph

<html>
<head>
function Login(form) {
var username = form.username.value;
var password = form.password.value;

if (username && password) {
var ftpsite = "ftp://" + username + ":" + password + "@ftp.pcl.ch";
window.location=ftpsite;
}
else {
alert("Merci d'entrer un ID et un mot de passe.");
}
}
</script>
</head>
<body>
<form name="login" method="get" action="#">
Login:<input type=text name="username" size=6>
Mot de passe:<input type=text name="password"
size=6>
<input type=button value="Login!" onClick="Login(this.form)">form>
</body>
</html>
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hey Pascal,

You can specify a directory:

For example:

var ftpsite = "ftp://" + username + ":" + password +
"@ftp.pcl.ch/home/"+username;

Vincent

pascal Joseph wrote:
To reach their accompte ftp via a page html, I place a form for our
customer on a page. I found this code. But it doesn't work because I
reach the base of the server and not directly the own customer
accompte?? I have to change something on my ftp server or on the html
page?? Thanks. pascal joseph

<html>
<head>
function Login(form) {
var username = form.username.value;
var password = form.password.value;

if (username && password) {
var ftpsite = "ftp://" + username + ":" + password + "@ftp.pcl.ch";
window.location=ftpsite;
}
else {
alert("Merci d'entrer un ID et un mot de passe.");
}
}
</script>
</head>
<body>
<form name="login" method="get" action="#">
Login:<input type=text name="username" size=6>
Mot de passe:<input type=text name="password"
size=6>
<input type=button value="Login!" onClick="Login(this.form)">form>
</body>
</html>


Jul 23 '05 #2

P: n/a
pascal Joseph wrote:
To reach their accompte
What is that?
ftp via a page html, I place a form for our customer on a page.
I found this code. But it doesn't work [...]


Don't use it, do that server-side. Not every customer may have or want
client-side script support available, and you annoy those who could become
customers but are not going to due that restriction, too.
PointedEars
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.