ftp via a form on page html ??

P

pascal Joseph

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>
 
V

Vincent van Beveren

Hey Pascal,

You can specify a directory:

For example:

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

Vincent
 
T

Thomas 'PointedEars' Lahn

pascal said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top