467,894 Members | 1,694 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,894 developers. It's quick & easy.

ftp via a form on page html ??

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
  • viewed: 2781
Share:
2 Replies
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
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.

Similar topics

2 posts views Thread by Citoyen du Monde | last post: by
3 posts views Thread by Harvey | last post: by
reply views Thread by 42 | last post: by
9 posts views Thread by eswanson | last post: by
4 posts views Thread by Alex Maghen | last post: by
4 posts views Thread by Cerebral Believer | last post: by
19 posts views Thread by Coward 9 | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.